Initial checkin
[ldk-swift-linux] / LDKSwift / Sources / LDKSwift / structs / InitFeatures.swift
1 import LDKCHeaders
2
3 public class InitFeatures {
4
5     public internal(set) var cOpaqueStruct: LDKInitFeatures?;
6
7         /* DEFAULT_CONSTRUCTOR_START */
8     public init() {
9         
10         self.cOpaqueStruct = InitFeatures_known()
11     }
12     /* DEFAULT_CONSTRUCTOR_END */
13
14     public init(pointer: LDKInitFeatures){
15                 self.cOpaqueStruct = pointer
16         }
17
18     /* STRUCT_METHODS_START */
19
20     public func eq(a: InitFeatures, b: InitFeatures) -> Bool {
21         
22         return withUnsafePointer(to: a.cOpaqueStruct!) { (aPointer: UnsafePointer<LDKInitFeatures>) in
23 withUnsafePointer(to: b.cOpaqueStruct!) { (bPointer: UnsafePointer<LDKInitFeatures>) in
24 InitFeatures_eq(aPointer, bPointer)
25 }
26 };
27     }
28
29     public func clone(orig: InitFeatures) -> InitFeatures {
30         
31         return withUnsafePointer(to: orig.cOpaqueStruct!) { (origPointer: UnsafePointer<LDKInitFeatures>) in
32 InitFeatures(pointer: InitFeatures_clone(origPointer))
33 };
34     }
35
36     public func supports_payment_secret() -> Bool {
37         
38         return withUnsafePointer(to: self.cOpaqueStruct!) { (this_argPointer: UnsafePointer<LDKInitFeatures>) in
39 InitFeatures_supports_payment_secret(this_argPointer)
40 };
41     }
42
43     public func write(obj: InitFeatures) -> [UInt8] {
44         
45         return Bindings.LDKCVec_u8Z_to_array(nativeType: withUnsafePointer(to: obj.cOpaqueStruct!) { (objPointer: UnsafePointer<LDKInitFeatures>) in
46 InitFeatures_write(objPointer)
47 });
48     }
49
50     public func read(ser: [UInt8]) -> Result_InitFeaturesDecodeErrorZ {
51         
52         return Result_InitFeaturesDecodeErrorZ(pointer: InitFeatures_read(Bindings.new_LDKu8slice(array: ser)));
53     }
54
55                                 
56         deinit {
57                                         if self.cOpaqueStruct?.is_owned == false {
58
59                                         
60                                         
61                 InitFeatures_free(self.cOpaqueStruct!)
62                                         
63 }
64                                 
65         }
66                         
67     /* STRUCT_METHODS_END */
68
69 }