3 public class RouteHop {
5 public internal(set) var cOpaqueStruct: LDKRouteHop?;
7 /* DEFAULT_CONSTRUCTOR_START */
8 public init(pubkey_arg: [UInt8], node_features_arg: NodeFeatures, short_channel_id_arg: UInt64, channel_features_arg: ChannelFeatures, fee_msat_arg: UInt64, cltv_expiry_delta_arg: UInt32) {
10 self.cOpaqueStruct = RouteHop_new(Bindings.new_LDKPublicKey(array: pubkey_arg), node_features_arg.cOpaqueStruct!, short_channel_id_arg, channel_features_arg.cOpaqueStruct!, fee_msat_arg, cltv_expiry_delta_arg)
12 /* DEFAULT_CONSTRUCTOR_END */
14 public init(pointer: LDKRouteHop){
15 self.cOpaqueStruct = pointer
18 /* STRUCT_METHODS_START */
20 public func get_pubkey() -> [UInt8] {
22 return Bindings.LDKPublicKey_to_array(nativeType: withUnsafePointer(to: self.cOpaqueStruct!) { (this_ptrPointer: UnsafePointer<LDKRouteHop>) in
23 RouteHop_get_pubkey(this_ptrPointer)
27 public func set_pubkey(val: [UInt8]) -> Void {
29 let this_ptrPointer = UnsafeMutablePointer<LDKRouteHop>.allocate(capacity: 1)
30 this_ptrPointer.initialize(to: self.cOpaqueStruct!)
32 return RouteHop_set_pubkey(this_ptrPointer, Bindings.new_LDKPublicKey(array: val));
35 public func get_node_features() -> NodeFeatures {
37 return NodeFeatures(pointer: withUnsafePointer(to: self.cOpaqueStruct!) { (this_ptrPointer: UnsafePointer<LDKRouteHop>) in
38 RouteHop_get_node_features(this_ptrPointer)
42 public func set_node_features(val: NodeFeatures) -> Void {
44 let this_ptrPointer = UnsafeMutablePointer<LDKRouteHop>.allocate(capacity: 1)
45 this_ptrPointer.initialize(to: self.cOpaqueStruct!)
47 return RouteHop_set_node_features(this_ptrPointer, val.cOpaqueStruct!);
50 public func get_short_channel_id() -> UInt64 {
52 return withUnsafePointer(to: self.cOpaqueStruct!) { (this_ptrPointer: UnsafePointer<LDKRouteHop>) in
53 RouteHop_get_short_channel_id(this_ptrPointer)
57 public func set_short_channel_id(val: UInt64) -> Void {
59 let this_ptrPointer = UnsafeMutablePointer<LDKRouteHop>.allocate(capacity: 1)
60 this_ptrPointer.initialize(to: self.cOpaqueStruct!)
62 return RouteHop_set_short_channel_id(this_ptrPointer, val);
65 public func get_channel_features() -> ChannelFeatures {
67 return ChannelFeatures(pointer: withUnsafePointer(to: self.cOpaqueStruct!) { (this_ptrPointer: UnsafePointer<LDKRouteHop>) in
68 RouteHop_get_channel_features(this_ptrPointer)
72 public func set_channel_features(val: ChannelFeatures) -> Void {
74 let this_ptrPointer = UnsafeMutablePointer<LDKRouteHop>.allocate(capacity: 1)
75 this_ptrPointer.initialize(to: self.cOpaqueStruct!)
77 return RouteHop_set_channel_features(this_ptrPointer, val.cOpaqueStruct!);
80 public func get_fee_msat() -> UInt64 {
82 return withUnsafePointer(to: self.cOpaqueStruct!) { (this_ptrPointer: UnsafePointer<LDKRouteHop>) in
83 RouteHop_get_fee_msat(this_ptrPointer)
87 public func set_fee_msat(val: UInt64) -> Void {
89 let this_ptrPointer = UnsafeMutablePointer<LDKRouteHop>.allocate(capacity: 1)
90 this_ptrPointer.initialize(to: self.cOpaqueStruct!)
92 return RouteHop_set_fee_msat(this_ptrPointer, val);
95 public func get_cltv_expiry_delta() -> UInt32 {
97 return withUnsafePointer(to: self.cOpaqueStruct!) { (this_ptrPointer: UnsafePointer<LDKRouteHop>) in
98 RouteHop_get_cltv_expiry_delta(this_ptrPointer)
102 public func set_cltv_expiry_delta(val: UInt32) -> Void {
104 let this_ptrPointer = UnsafeMutablePointer<LDKRouteHop>.allocate(capacity: 1)
105 this_ptrPointer.initialize(to: self.cOpaqueStruct!)
107 return RouteHop_set_cltv_expiry_delta(this_ptrPointer, val);
110 public func clone(orig: RouteHop) -> RouteHop {
112 return withUnsafePointer(to: orig.cOpaqueStruct!) { (origPointer: UnsafePointer<LDKRouteHop>) in
113 RouteHop(pointer: RouteHop_clone(origPointer))
117 public func write(obj: RouteHop) -> [UInt8] {
119 return Bindings.LDKCVec_u8Z_to_array(nativeType: withUnsafePointer(to: obj.cOpaqueStruct!) { (objPointer: UnsafePointer<LDKRouteHop>) in
120 RouteHop_write(objPointer)
124 public func read(ser: [UInt8]) -> Result_RouteHopDecodeErrorZ {
126 return Result_RouteHopDecodeErrorZ(pointer: RouteHop_read(Bindings.new_LDKu8slice(array: ser)));
131 if self.cOpaqueStruct?.is_owned == false {
135 RouteHop_free(self.cOpaqueStruct!)
141 /* STRUCT_METHODS_END */