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