3 public class ChannelInfo {
5 public internal(set) var cOpaqueStruct: LDKChannelInfo?;
7 /* DEFAULT_CONSTRUCTOR_START */
8 public init(features_arg: ChannelFeatures, node_one_arg: [UInt8], one_to_two_arg: DirectionalChannelInfo, node_two_arg: [UInt8], two_to_one_arg: DirectionalChannelInfo, capacity_sats_arg: Option_u64Z, announcement_message_arg: ChannelAnnouncement) {
10 self.cOpaqueStruct = ChannelInfo_new(features_arg.cOpaqueStruct!, Bindings.new_LDKPublicKey(array: node_one_arg), one_to_two_arg.cOpaqueStruct!, Bindings.new_LDKPublicKey(array: node_two_arg), two_to_one_arg.cOpaqueStruct!, capacity_sats_arg.cOpaqueStruct!, announcement_message_arg.cOpaqueStruct!)
12 /* DEFAULT_CONSTRUCTOR_END */
14 public init(pointer: LDKChannelInfo){
15 self.cOpaqueStruct = pointer
18 /* STRUCT_METHODS_START */
20 public func get_features() -> ChannelFeatures {
22 return ChannelFeatures(pointer: withUnsafePointer(to: self.cOpaqueStruct!) { (this_ptrPointer: UnsafePointer<LDKChannelInfo>) in
23 ChannelInfo_get_features(this_ptrPointer)
27 public func set_features(val: ChannelFeatures) -> Void {
29 let this_ptrPointer = UnsafeMutablePointer<LDKChannelInfo>.allocate(capacity: 1)
30 this_ptrPointer.initialize(to: self.cOpaqueStruct!)
32 return ChannelInfo_set_features(this_ptrPointer, val.cOpaqueStruct!);
35 public func get_node_one() -> [UInt8] {
37 return Bindings.LDKPublicKey_to_array(nativeType: withUnsafePointer(to: self.cOpaqueStruct!) { (this_ptrPointer: UnsafePointer<LDKChannelInfo>) in
38 ChannelInfo_get_node_one(this_ptrPointer)
42 public func set_node_one(val: [UInt8]) -> Void {
44 let this_ptrPointer = UnsafeMutablePointer<LDKChannelInfo>.allocate(capacity: 1)
45 this_ptrPointer.initialize(to: self.cOpaqueStruct!)
47 return ChannelInfo_set_node_one(this_ptrPointer, Bindings.new_LDKPublicKey(array: val));
50 public func get_one_to_two() -> DirectionalChannelInfo {
52 return DirectionalChannelInfo(pointer: withUnsafePointer(to: self.cOpaqueStruct!) { (this_ptrPointer: UnsafePointer<LDKChannelInfo>) in
53 ChannelInfo_get_one_to_two(this_ptrPointer)
57 public func set_one_to_two(val: DirectionalChannelInfo) -> Void {
59 let this_ptrPointer = UnsafeMutablePointer<LDKChannelInfo>.allocate(capacity: 1)
60 this_ptrPointer.initialize(to: self.cOpaqueStruct!)
62 return ChannelInfo_set_one_to_two(this_ptrPointer, val.cOpaqueStruct!);
65 public func get_node_two() -> [UInt8] {
67 return Bindings.LDKPublicKey_to_array(nativeType: withUnsafePointer(to: self.cOpaqueStruct!) { (this_ptrPointer: UnsafePointer<LDKChannelInfo>) in
68 ChannelInfo_get_node_two(this_ptrPointer)
72 public func set_node_two(val: [UInt8]) -> Void {
74 let this_ptrPointer = UnsafeMutablePointer<LDKChannelInfo>.allocate(capacity: 1)
75 this_ptrPointer.initialize(to: self.cOpaqueStruct!)
77 return ChannelInfo_set_node_two(this_ptrPointer, Bindings.new_LDKPublicKey(array: val));
80 public func get_two_to_one() -> DirectionalChannelInfo {
82 return DirectionalChannelInfo(pointer: withUnsafePointer(to: self.cOpaqueStruct!) { (this_ptrPointer: UnsafePointer<LDKChannelInfo>) in
83 ChannelInfo_get_two_to_one(this_ptrPointer)
87 public func set_two_to_one(val: DirectionalChannelInfo) -> Void {
89 let this_ptrPointer = UnsafeMutablePointer<LDKChannelInfo>.allocate(capacity: 1)
90 this_ptrPointer.initialize(to: self.cOpaqueStruct!)
92 return ChannelInfo_set_two_to_one(this_ptrPointer, val.cOpaqueStruct!);
95 public func get_capacity_sats() -> Option_u64Z {
97 return Option_u64Z(pointer: withUnsafePointer(to: self.cOpaqueStruct!) { (this_ptrPointer: UnsafePointer<LDKChannelInfo>) in
98 ChannelInfo_get_capacity_sats(this_ptrPointer)
102 public func set_capacity_sats(val: Option_u64Z) -> Void {
104 let this_ptrPointer = UnsafeMutablePointer<LDKChannelInfo>.allocate(capacity: 1)
105 this_ptrPointer.initialize(to: self.cOpaqueStruct!)
107 return ChannelInfo_set_capacity_sats(this_ptrPointer, val.cOpaqueStruct!);
110 public func get_announcement_message() -> ChannelAnnouncement {
112 return ChannelAnnouncement(pointer: withUnsafePointer(to: self.cOpaqueStruct!) { (this_ptrPointer: UnsafePointer<LDKChannelInfo>) in
113 ChannelInfo_get_announcement_message(this_ptrPointer)
117 public func set_announcement_message(val: ChannelAnnouncement) -> Void {
119 let this_ptrPointer = UnsafeMutablePointer<LDKChannelInfo>.allocate(capacity: 1)
120 this_ptrPointer.initialize(to: self.cOpaqueStruct!)
122 return ChannelInfo_set_announcement_message(this_ptrPointer, val.cOpaqueStruct!);
125 public func clone(orig: ChannelInfo) -> ChannelInfo {
127 return withUnsafePointer(to: orig.cOpaqueStruct!) { (origPointer: UnsafePointer<LDKChannelInfo>) in
128 ChannelInfo(pointer: ChannelInfo_clone(origPointer))
132 public func write(obj: ChannelInfo) -> [UInt8] {
134 return Bindings.LDKCVec_u8Z_to_array(nativeType: withUnsafePointer(to: obj.cOpaqueStruct!) { (objPointer: UnsafePointer<LDKChannelInfo>) in
135 ChannelInfo_write(objPointer)
139 public func read(ser: [UInt8]) -> Result_ChannelInfoDecodeErrorZ {
141 return Result_ChannelInfoDecodeErrorZ(pointer: ChannelInfo_read(Bindings.new_LDKu8slice(array: ser)));
146 if self.cOpaqueStruct?.is_owned == false {
150 ChannelInfo_free(self.cOpaqueStruct!)
156 /* STRUCT_METHODS_END */