3 public class Shutdown {
5 public internal(set) var cOpaqueStruct: LDKShutdown?;
7 /* DEFAULT_CONSTRUCTOR_START */
8 public init(channel_id_arg: [UInt8], scriptpubkey_arg: [UInt8]) {
10 self.cOpaqueStruct = Shutdown_new(Bindings.new_LDKThirtyTwoBytes(array: channel_id_arg), Bindings.new_LDKCVec_u8Z(array: scriptpubkey_arg))
12 /* DEFAULT_CONSTRUCTOR_END */
14 public init(pointer: LDKShutdown){
15 self.cOpaqueStruct = pointer
18 /* STRUCT_METHODS_START */
20 public func get_channel_id() -> [UInt8] {
22 return Bindings.tuple32_to_array(nativeType: withUnsafePointer(to: self.cOpaqueStruct!) { (this_ptrPointer: UnsafePointer<LDKShutdown>) in
23 Shutdown_get_channel_id(this_ptrPointer)
27 public func set_channel_id(val: [UInt8]) -> Void {
29 let this_ptrPointer = UnsafeMutablePointer<LDKShutdown>.allocate(capacity: 1)
30 this_ptrPointer.initialize(to: self.cOpaqueStruct!)
32 return Shutdown_set_channel_id(this_ptrPointer, Bindings.new_LDKThirtyTwoBytes(array: val));
35 public func get_scriptpubkey() -> [UInt8] {
37 return Bindings.LDKu8slice_to_array(nativeType: withUnsafePointer(to: self.cOpaqueStruct!) { (this_ptrPointer: UnsafePointer<LDKShutdown>) in
38 Shutdown_get_scriptpubkey(this_ptrPointer)
42 public func set_scriptpubkey(val: [UInt8]) -> Void {
44 let this_ptrPointer = UnsafeMutablePointer<LDKShutdown>.allocate(capacity: 1)
45 this_ptrPointer.initialize(to: self.cOpaqueStruct!)
47 return Shutdown_set_scriptpubkey(this_ptrPointer, Bindings.new_LDKCVec_u8Z(array: val));
50 public func clone(orig: Shutdown) -> Shutdown {
52 return withUnsafePointer(to: orig.cOpaqueStruct!) { (origPointer: UnsafePointer<LDKShutdown>) in
53 Shutdown(pointer: Shutdown_clone(origPointer))
57 public func write(obj: Shutdown) -> [UInt8] {
59 return Bindings.LDKCVec_u8Z_to_array(nativeType: withUnsafePointer(to: obj.cOpaqueStruct!) { (objPointer: UnsafePointer<LDKShutdown>) in
60 Shutdown_write(objPointer)
64 public func read(ser: [UInt8]) -> Result_ShutdownDecodeErrorZ {
66 return Result_ShutdownDecodeErrorZ(pointer: Shutdown_read(Bindings.new_LDKu8slice(array: ser)));
71 if self.cOpaqueStruct?.is_owned == false {
75 Shutdown_free(self.cOpaqueStruct!)
81 /* STRUCT_METHODS_END */