admin
2023-04-21 57e30bc2584b92ce3da3821bd0f6e040f2ad28df
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
29
30
31
//
//  OKResult.h
//  OneKit
//
//  Created by bytedance on 2022/2/7.
//
 
#import <Foundation/Foundation.h>
 
NS_ASSUME_NONNULL_BEGIN
 
typedef NS_ENUM(NSUInteger, OKResultMeta) {
    OKResultSuccess,
    OKResultFailure,
};
 
@interface OKResult : NSObject
 
+ (instancetype)new NS_UNAVAILABLE;
- (instancetype)init NS_UNAVAILABLE;
 
+ (OKResult *)success: (nonnull id)value;
+ (OKResult *)failure: (nonnull NSError *)error;
 
@property (readonly) OKResultMeta metaType;
@property (readonly) id value;
@property (readonly) NSError * error;
 
@end
 
NS_ASSUME_NONNULL_END