3 public class RoutingFees {
5 public internal(set) var cOpaqueStruct: LDKRoutingFees?;
7 /* DEFAULT_CONSTRUCTOR_START */
8 public init(base_msat_arg: UInt32, proportional_millionths_arg: UInt32) {
10 self.cOpaqueStruct = RoutingFees_new(base_msat_arg, proportional_millionths_arg)
12 /* DEFAULT_CONSTRUCTOR_END */
14 public init(pointer: LDKRoutingFees){
15 self.cOpaqueStruct = pointer
18 /* STRUCT_METHODS_START */
20 public func get_base_msat() -> UInt32 {
22 return withUnsafePointer(to: self.cOpaqueStruct!) { (this_ptrPointer: UnsafePointer<LDKRoutingFees>) in
23 RoutingFees_get_base_msat(this_ptrPointer)
27 public func set_base_msat(val: UInt32) -> Void {
29 let this_ptrPointer = UnsafeMutablePointer<LDKRoutingFees>.allocate(capacity: 1)
30 this_ptrPointer.initialize(to: self.cOpaqueStruct!)
32 return RoutingFees_set_base_msat(this_ptrPointer, val);
35 public func get_proportional_millionths() -> UInt32 {
37 return withUnsafePointer(to: self.cOpaqueStruct!) { (this_ptrPointer: UnsafePointer<LDKRoutingFees>) in
38 RoutingFees_get_proportional_millionths(this_ptrPointer)
42 public func set_proportional_millionths(val: UInt32) -> Void {
44 let this_ptrPointer = UnsafeMutablePointer<LDKRoutingFees>.allocate(capacity: 1)
45 this_ptrPointer.initialize(to: self.cOpaqueStruct!)
47 return RoutingFees_set_proportional_millionths(this_ptrPointer, val);
50 public func eq(a: RoutingFees, b: RoutingFees) -> Bool {
52 return withUnsafePointer(to: a.cOpaqueStruct!) { (aPointer: UnsafePointer<LDKRoutingFees>) in
53 withUnsafePointer(to: b.cOpaqueStruct!) { (bPointer: UnsafePointer<LDKRoutingFees>) in
54 RoutingFees_eq(aPointer, bPointer)
59 public func clone(orig: RoutingFees) -> RoutingFees {
61 return withUnsafePointer(to: orig.cOpaqueStruct!) { (origPointer: UnsafePointer<LDKRoutingFees>) in
62 RoutingFees(pointer: RoutingFees_clone(origPointer))
66 public func write(obj: RoutingFees) -> [UInt8] {
68 return Bindings.LDKCVec_u8Z_to_array(nativeType: withUnsafePointer(to: obj.cOpaqueStruct!) { (objPointer: UnsafePointer<LDKRoutingFees>) in
69 RoutingFees_write(objPointer)
73 public func read(ser: [UInt8]) -> Result_RoutingFeesDecodeErrorZ {
75 return Result_RoutingFeesDecodeErrorZ(pointer: RoutingFees_read(Bindings.new_LDKu8slice(array: ser)));
80 if self.cOpaqueStruct?.is_owned == false {
84 RoutingFees_free(self.cOpaqueStruct!)
90 /* STRUCT_METHODS_END */