5 public var cOpaqueStruct: LDKAccess?;
9 /* NATIVE_CALLBACKS_START */
11 func get_utxoCallback(pointer: UnsafeRawPointer?, genesis_hashPointer: UnsafePointer<(UInt8,UInt8,UInt8,UInt8,UInt8,UInt8,UInt8,UInt8,UInt8,UInt8,UInt8,UInt8,UInt8,UInt8,UInt8,UInt8,UInt8,UInt8,UInt8,UInt8,UInt8,UInt8,UInt8,UInt8,UInt8,UInt8,UInt8,UInt8,UInt8,UInt8,UInt8,UInt8)>?, short_channel_id: UInt64) -> LDKCResult_TxOutAccessErrorZ {
12 let instance: Access = Bindings.pointerToInstance(pointer: pointer!, sourceMarker: "Access.swift::get_utxo")
14 var genesis_hash: [UInt8]? = nil
15 if let genesis_hashUnwrapped = genesis_hashPointer {
16 genesis_hash = Bindings.tuple32_to_array(nativeType: genesis_hashUnwrapped.pointee)
19 return instance.get_utxo(genesis_hash: genesis_hash, short_channel_id: short_channel_id).cOpaqueStruct!;
22 func freeCallback(pointer: UnsafeMutableRawPointer?) -> Void {
23 let instance: Access = Bindings.pointerToInstance(pointer: pointer!, sourceMarker: "Access.swift::free")
25 return instance.free();
28 /* NATIVE_CALLBACKS_END */
30 self.cOpaqueStruct = LDKAccess(this_arg: Bindings.instanceToPointer(instance: self),
31 get_utxo: get_utxoCallback,
35 public init(pointer: LDKAccess){
36 self.cOpaqueStruct = pointer
39 /* SWIFT_CALLBACKS_START */
41 open func get_utxo(genesis_hash: [UInt8]?, short_channel_id: UInt64) -> Result_TxOutAccessErrorZ {
43 return Result_TxOutAccessErrorZ(pointer: LDKCResult_TxOutAccessErrorZ())
46 open func free() -> Void {
51 /* SWIFT_CALLBACKS_END */
56 public class NativelyImplementedAccess: Access {
57 /* SWIFT_DEFAULT_CALLBACKS_START */
59 public override func get_utxo(genesis_hash: [UInt8]?, short_channel_id: UInt64) -> Result_TxOutAccessErrorZ {
61 return withUnsafePointer(to: Bindings.array_to_tuple32(array: genesis_hash!)) { (genesis_hashPointer: UnsafePointer<(UInt8,UInt8,UInt8,UInt8,UInt8,UInt8,UInt8,UInt8,UInt8,UInt8,UInt8,UInt8,UInt8,UInt8,UInt8,UInt8,UInt8,UInt8,UInt8,UInt8,UInt8,UInt8,UInt8,UInt8,UInt8,UInt8,UInt8,UInt8,UInt8,UInt8,UInt8,UInt8)>) in
63 Result_TxOutAccessErrorZ(pointer: self.cOpaqueStruct!.get_utxo(self.cOpaqueStruct!.this_arg, genesis_hashPointer, short_channel_id))
69 public override func free() -> Void {
72 self.cOpaqueStruct!.free(self.cOpaqueStruct!.this_arg)
77 /* SWIFT_DEFAULT_CALLBACKS_END */