3 public class NodeInfo {
5 public internal(set) var cOpaqueStruct: LDKNodeInfo?;
7 /* DEFAULT_CONSTRUCTOR_START */
8 public init(channels_arg: [UInt64], lowest_inbound_channel_fees_arg: RoutingFees, announcement_info_arg: NodeAnnouncementInfo) {
10 self.cOpaqueStruct = NodeInfo_new(Bindings.new_LDKCVec_u64Z(array: channels_arg), lowest_inbound_channel_fees_arg.cOpaqueStruct!, announcement_info_arg.cOpaqueStruct!)
12 /* DEFAULT_CONSTRUCTOR_END */
14 public init(pointer: LDKNodeInfo){
15 self.cOpaqueStruct = pointer
18 /* STRUCT_METHODS_START */
20 public func set_channels(val: [UInt64]) -> Void {
22 let this_ptrPointer = UnsafeMutablePointer<LDKNodeInfo>.allocate(capacity: 1)
23 this_ptrPointer.initialize(to: self.cOpaqueStruct!)
25 return NodeInfo_set_channels(this_ptrPointer, Bindings.new_LDKCVec_u64Z(array: val));
28 public func get_lowest_inbound_channel_fees() -> RoutingFees {
30 return RoutingFees(pointer: withUnsafePointer(to: self.cOpaqueStruct!) { (this_ptrPointer: UnsafePointer<LDKNodeInfo>) in
31 NodeInfo_get_lowest_inbound_channel_fees(this_ptrPointer)
35 public func set_lowest_inbound_channel_fees(val: RoutingFees) -> Void {
37 let this_ptrPointer = UnsafeMutablePointer<LDKNodeInfo>.allocate(capacity: 1)
38 this_ptrPointer.initialize(to: self.cOpaqueStruct!)
40 return NodeInfo_set_lowest_inbound_channel_fees(this_ptrPointer, val.cOpaqueStruct!);
43 public func get_announcement_info() -> NodeAnnouncementInfo {
45 return NodeAnnouncementInfo(pointer: withUnsafePointer(to: self.cOpaqueStruct!) { (this_ptrPointer: UnsafePointer<LDKNodeInfo>) in
46 NodeInfo_get_announcement_info(this_ptrPointer)
50 public func set_announcement_info(val: NodeAnnouncementInfo) -> Void {
52 let this_ptrPointer = UnsafeMutablePointer<LDKNodeInfo>.allocate(capacity: 1)
53 this_ptrPointer.initialize(to: self.cOpaqueStruct!)
55 return NodeInfo_set_announcement_info(this_ptrPointer, val.cOpaqueStruct!);
58 public func clone(orig: NodeInfo) -> NodeInfo {
60 return withUnsafePointer(to: orig.cOpaqueStruct!) { (origPointer: UnsafePointer<LDKNodeInfo>) in
61 NodeInfo(pointer: NodeInfo_clone(origPointer))
65 public func write(obj: NodeInfo) -> [UInt8] {
67 return Bindings.LDKCVec_u8Z_to_array(nativeType: withUnsafePointer(to: obj.cOpaqueStruct!) { (objPointer: UnsafePointer<LDKNodeInfo>) in
68 NodeInfo_write(objPointer)
72 public func read(ser: [UInt8]) -> Result_NodeInfoDecodeErrorZ {
74 return Result_NodeInfoDecodeErrorZ(pointer: NodeInfo_read(Bindings.new_LDKu8slice(array: ser)));
79 if self.cOpaqueStruct?.is_owned == false {
83 NodeInfo_free(self.cOpaqueStruct!)
89 /* STRUCT_METHODS_END */