blob: 93fc4c2ce3fa015886b088015f31d7dff5b9dea5 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
// SPDX-License-Identifier: MIT
// Copyright © 2018 WireGuard LLC. All Rights Reserved.
enum WireGuardResult<T> {
case success(T)
case failure(WireGuardAppError)
var value: T? {
switch (self) {
case .success(let v): return v
case .failure(_): return nil
}
}
var error: WireGuardAppError? {
switch (self) {
case .success(_): return nil
case .failure(let e): return e
}
}
var isSuccess: Bool {
switch (self) {
case .success(_): return true
case .failure(_): return false
}
}
}
|