3 public class DirectionalChannelInfo {
5 public internal(set) var cOpaqueStruct: LDKDirectionalChannelInfo?;
7 /* DEFAULT_CONSTRUCTOR_START */
8 public init(last_update_arg: UInt32, enabled_arg: Bool, cltv_expiry_delta_arg: UInt16, htlc_minimum_msat_arg: UInt64, htlc_maximum_msat_arg: Option_u64Z, fees_arg: RoutingFees, last_update_message_arg: ChannelUpdate) {
10 self.cOpaqueStruct = DirectionalChannelInfo_new(last_update_arg, enabled_arg, cltv_expiry_delta_arg, htlc_minimum_msat_arg, htlc_maximum_msat_arg.cOpaqueStruct!, fees_arg.cOpaqueStruct!, last_update_message_arg.cOpaqueStruct!)
12 /* DEFAULT_CONSTRUCTOR_END */
14 public init(pointer: LDKDirectionalChannelInfo){
15 self.cOpaqueStruct = pointer
18 /* STRUCT_METHODS_START */
20 public func get_last_update() -> UInt32 {
22 return withUnsafePointer(to: self.cOpaqueStruct!) { (this_ptrPointer: UnsafePointer<LDKDirectionalChannelInfo>) in
23 DirectionalChannelInfo_get_last_update(this_ptrPointer)
27 public func set_last_update(val: UInt32) -> Void {
29 let this_ptrPointer = UnsafeMutablePointer<LDKDirectionalChannelInfo>.allocate(capacity: 1)
30 this_ptrPointer.initialize(to: self.cOpaqueStruct!)
32 return DirectionalChannelInfo_set_last_update(this_ptrPointer, val);
35 public func get_enabled() -> Bool {
37 return withUnsafePointer(to: self.cOpaqueStruct!) { (this_ptrPointer: UnsafePointer<LDKDirectionalChannelInfo>) in
38 DirectionalChannelInfo_get_enabled(this_ptrPointer)
42 public func set_enabled(val: Bool) -> Void {
44 let this_ptrPointer = UnsafeMutablePointer<LDKDirectionalChannelInfo>.allocate(capacity: 1)
45 this_ptrPointer.initialize(to: self.cOpaqueStruct!)
47 return DirectionalChannelInfo_set_enabled(this_ptrPointer, val);
50 public func get_cltv_expiry_delta() -> UInt16 {
52 return withUnsafePointer(to: self.cOpaqueStruct!) { (this_ptrPointer: UnsafePointer<LDKDirectionalChannelInfo>) in
53 DirectionalChannelInfo_get_cltv_expiry_delta(this_ptrPointer)
57 public func set_cltv_expiry_delta(val: UInt16) -> Void {
59 let this_ptrPointer = UnsafeMutablePointer<LDKDirectionalChannelInfo>.allocate(capacity: 1)
60 this_ptrPointer.initialize(to: self.cOpaqueStruct!)
62 return DirectionalChannelInfo_set_cltv_expiry_delta(this_ptrPointer, val);
65 public func get_htlc_minimum_msat() -> UInt64 {
67 return withUnsafePointer(to: self.cOpaqueStruct!) { (this_ptrPointer: UnsafePointer<LDKDirectionalChannelInfo>) in
68 DirectionalChannelInfo_get_htlc_minimum_msat(this_ptrPointer)
72 public func set_htlc_minimum_msat(val: UInt64) -> Void {
74 let this_ptrPointer = UnsafeMutablePointer<LDKDirectionalChannelInfo>.allocate(capacity: 1)
75 this_ptrPointer.initialize(to: self.cOpaqueStruct!)
77 return DirectionalChannelInfo_set_htlc_minimum_msat(this_ptrPointer, val);
80 public func get_htlc_maximum_msat() -> Option_u64Z {
82 return Option_u64Z(pointer: withUnsafePointer(to: self.cOpaqueStruct!) { (this_ptrPointer: UnsafePointer<LDKDirectionalChannelInfo>) in
83 DirectionalChannelInfo_get_htlc_maximum_msat(this_ptrPointer)
87 public func set_htlc_maximum_msat(val: Option_u64Z) -> Void {
89 let this_ptrPointer = UnsafeMutablePointer<LDKDirectionalChannelInfo>.allocate(capacity: 1)
90 this_ptrPointer.initialize(to: self.cOpaqueStruct!)
92 return DirectionalChannelInfo_set_htlc_maximum_msat(this_ptrPointer, val.cOpaqueStruct!);
95 public func get_fees() -> RoutingFees {
97 return RoutingFees(pointer: withUnsafePointer(to: self.cOpaqueStruct!) { (this_ptrPointer: UnsafePointer<LDKDirectionalChannelInfo>) in
98 DirectionalChannelInfo_get_fees(this_ptrPointer)
102 public func set_fees(val: RoutingFees) -> Void {
104 let this_ptrPointer = UnsafeMutablePointer<LDKDirectionalChannelInfo>.allocate(capacity: 1)
105 this_ptrPointer.initialize(to: self.cOpaqueStruct!)
107 return DirectionalChannelInfo_set_fees(this_ptrPointer, val.cOpaqueStruct!);
110 public func get_last_update_message() -> ChannelUpdate {
112 return ChannelUpdate(pointer: withUnsafePointer(to: self.cOpaqueStruct!) { (this_ptrPointer: UnsafePointer<LDKDirectionalChannelInfo>) in
113 DirectionalChannelInfo_get_last_update_message(this_ptrPointer)
117 public func set_last_update_message(val: ChannelUpdate) -> Void {
119 let this_ptrPointer = UnsafeMutablePointer<LDKDirectionalChannelInfo>.allocate(capacity: 1)
120 this_ptrPointer.initialize(to: self.cOpaqueStruct!)
122 return DirectionalChannelInfo_set_last_update_message(this_ptrPointer, val.cOpaqueStruct!);
125 public func clone(orig: DirectionalChannelInfo) -> DirectionalChannelInfo {
127 return withUnsafePointer(to: orig.cOpaqueStruct!) { (origPointer: UnsafePointer<LDKDirectionalChannelInfo>) in
128 DirectionalChannelInfo(pointer: DirectionalChannelInfo_clone(origPointer))
132 public func write(obj: DirectionalChannelInfo) -> [UInt8] {
134 return Bindings.LDKCVec_u8Z_to_array(nativeType: withUnsafePointer(to: obj.cOpaqueStruct!) { (objPointer: UnsafePointer<LDKDirectionalChannelInfo>) in
135 DirectionalChannelInfo_write(objPointer)
139 public func read(ser: [UInt8]) -> Result_DirectionalChannelInfoDecodeErrorZ {
141 return Result_DirectionalChannelInfoDecodeErrorZ(pointer: DirectionalChannelInfo_read(Bindings.new_LDKu8slice(array: ser)));
146 if self.cOpaqueStruct?.is_owned == false {
150 DirectionalChannelInfo_free(self.cOpaqueStruct!)
156 /* STRUCT_METHODS_END */