Initial checkin
[ldk-swift-linux] / LDKSwift / Sources / LDKSwift / structs / ChannelMonitorUpdate.swift
1 import LDKCHeaders
2
3 public class ChannelMonitorUpdate {
4
5     public internal(set) var cOpaqueStruct: LDKChannelMonitorUpdate?;
6
7         
8
9     public init(pointer: LDKChannelMonitorUpdate){
10                 self.cOpaqueStruct = pointer
11         }
12
13     /* STRUCT_METHODS_START */
14
15     public func get_update_id() -> UInt64 {
16         
17         return withUnsafePointer(to: self.cOpaqueStruct!) { (this_ptrPointer: UnsafePointer<LDKChannelMonitorUpdate>) in
18 ChannelMonitorUpdate_get_update_id(this_ptrPointer)
19 };
20     }
21
22     public func set_update_id(val: UInt64) -> Void {
23         
24                                                         let this_ptrPointer = UnsafeMutablePointer<LDKChannelMonitorUpdate>.allocate(capacity: 1)
25                                                         this_ptrPointer.initialize(to: self.cOpaqueStruct!)
26                                                 
27         return ChannelMonitorUpdate_set_update_id(this_ptrPointer, val);
28     }
29
30     public func clone(orig: ChannelMonitorUpdate) -> ChannelMonitorUpdate {
31         
32         return withUnsafePointer(to: orig.cOpaqueStruct!) { (origPointer: UnsafePointer<LDKChannelMonitorUpdate>) in
33 ChannelMonitorUpdate(pointer: ChannelMonitorUpdate_clone(origPointer))
34 };
35     }
36
37     public func write(obj: ChannelMonitorUpdate) -> [UInt8] {
38         
39         return Bindings.LDKCVec_u8Z_to_array(nativeType: withUnsafePointer(to: obj.cOpaqueStruct!) { (objPointer: UnsafePointer<LDKChannelMonitorUpdate>) in
40 ChannelMonitorUpdate_write(objPointer)
41 });
42     }
43
44     public func read(ser: [UInt8]) -> Result_ChannelMonitorUpdateDecodeErrorZ {
45         
46         return Result_ChannelMonitorUpdateDecodeErrorZ(pointer: ChannelMonitorUpdate_read(Bindings.new_LDKu8slice(array: ser)));
47     }
48
49                                 
50         deinit {
51                                         if self.cOpaqueStruct?.is_owned == false {
52
53                                         
54                                         
55                 ChannelMonitorUpdate_free(self.cOpaqueStruct!)
56                                         
57 }
58                                 
59         }
60                         
61     /* STRUCT_METHODS_END */
62
63 }