Initial checkin
[ldk-swift-linux] / LDKSwift / Sources / LDKSwift / structs / HTLCUpdate.swift
1 import LDKCHeaders
2
3 public class HTLCUpdate {
4
5     public internal(set) var cOpaqueStruct: LDKHTLCUpdate?;
6
7         
8
9     public init(pointer: LDKHTLCUpdate){
10                 self.cOpaqueStruct = pointer
11         }
12
13     /* STRUCT_METHODS_START */
14
15     public func clone(orig: HTLCUpdate) -> HTLCUpdate {
16         
17         return withUnsafePointer(to: orig.cOpaqueStruct!) { (origPointer: UnsafePointer<LDKHTLCUpdate>) in
18 HTLCUpdate(pointer: HTLCUpdate_clone(origPointer))
19 };
20     }
21
22     public func write(obj: HTLCUpdate) -> [UInt8] {
23         
24         return Bindings.LDKCVec_u8Z_to_array(nativeType: withUnsafePointer(to: obj.cOpaqueStruct!) { (objPointer: UnsafePointer<LDKHTLCUpdate>) in
25 HTLCUpdate_write(objPointer)
26 });
27     }
28
29     public func read(ser: [UInt8]) -> Result_HTLCUpdateDecodeErrorZ {
30         
31         return Result_HTLCUpdateDecodeErrorZ(pointer: HTLCUpdate_read(Bindings.new_LDKu8slice(array: ser)));
32     }
33
34                                 
35         deinit {
36                                         if self.cOpaqueStruct?.is_owned == false {
37
38                                         
39                                         
40                 HTLCUpdate_free(self.cOpaqueStruct!)
41                                         
42 }
43                                 
44         }
45                         
46     /* STRUCT_METHODS_END */
47
48 }