3 public class ChannelUpdate {
5 public internal(set) var cOpaqueStruct: LDKChannelUpdate?;
7 /* DEFAULT_CONSTRUCTOR_START */
8 public init(signature_arg: [UInt8], contents_arg: UnsignedChannelUpdate) {
10 self.cOpaqueStruct = ChannelUpdate_new(Bindings.new_LDKSignature(array: signature_arg), contents_arg.cOpaqueStruct!)
12 /* DEFAULT_CONSTRUCTOR_END */
14 public init(pointer: LDKChannelUpdate){
15 self.cOpaqueStruct = pointer
18 /* STRUCT_METHODS_START */
20 public func get_signature() -> [UInt8] {
22 return Bindings.LDKSignature_to_array(nativeType: withUnsafePointer(to: self.cOpaqueStruct!) { (this_ptrPointer: UnsafePointer<LDKChannelUpdate>) in
23 ChannelUpdate_get_signature(this_ptrPointer)
27 public func set_signature(val: [UInt8]) -> Void {
29 let this_ptrPointer = UnsafeMutablePointer<LDKChannelUpdate>.allocate(capacity: 1)
30 this_ptrPointer.initialize(to: self.cOpaqueStruct!)
32 return ChannelUpdate_set_signature(this_ptrPointer, Bindings.new_LDKSignature(array: val));
35 public func get_contents() -> UnsignedChannelUpdate {
37 return UnsignedChannelUpdate(pointer: withUnsafePointer(to: self.cOpaqueStruct!) { (this_ptrPointer: UnsafePointer<LDKChannelUpdate>) in
38 ChannelUpdate_get_contents(this_ptrPointer)
42 public func set_contents(val: UnsignedChannelUpdate) -> Void {
44 let this_ptrPointer = UnsafeMutablePointer<LDKChannelUpdate>.allocate(capacity: 1)
45 this_ptrPointer.initialize(to: self.cOpaqueStruct!)
47 return ChannelUpdate_set_contents(this_ptrPointer, val.cOpaqueStruct!);
50 public func clone(orig: ChannelUpdate) -> ChannelUpdate {
52 return withUnsafePointer(to: orig.cOpaqueStruct!) { (origPointer: UnsafePointer<LDKChannelUpdate>) in
53 ChannelUpdate(pointer: ChannelUpdate_clone(origPointer))
57 public func write(obj: ChannelUpdate) -> [UInt8] {
59 return Bindings.LDKCVec_u8Z_to_array(nativeType: withUnsafePointer(to: obj.cOpaqueStruct!) { (objPointer: UnsafePointer<LDKChannelUpdate>) in
60 ChannelUpdate_write(objPointer)
64 public func read(ser: [UInt8]) -> Result_ChannelUpdateDecodeErrorZ {
66 return Result_ChannelUpdateDecodeErrorZ(pointer: ChannelUpdate_read(Bindings.new_LDKu8slice(array: ser)));
71 if self.cOpaqueStruct?.is_owned == false {
75 ChannelUpdate_free(self.cOpaqueStruct!)
81 /* STRUCT_METHODS_END */