//! order to announce a channel. This module handles that checking.
use alloc::str::FromStr;
+use alloc::string::String;
use core::ffi::c_void;
use core::convert::Infallible;
use bitcoin::hashes::Hash;
match native {
nativeUtxoResult::Sync (ref a, ) => {
let mut a_nonref = Clone::clone(a);
- let mut local_a_nonref = match a_nonref { Ok(mut o) => crate::c_types::CResultTempl::ok( { crate::c_types::TxOut::from_rust(o) }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { crate::lightning::routing::utxo::UtxoLookupError::native_into(e) }).into() };
+ let mut local_a_nonref = match a_nonref { Ok(mut o) => crate::c_types::CResultTempl::ok( { crate::c_types::TxOut::from_rust(&o) }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { crate::lightning::routing::utxo::UtxoLookupError::native_into(e) }).into() };
UtxoResult::Sync (
local_a_nonref,
)
pub(crate) fn native_into(native: nativeUtxoResult) -> Self {
match native {
nativeUtxoResult::Sync (mut a, ) => {
- let mut local_a = match a { Ok(mut o) => crate::c_types::CResultTempl::ok( { crate::c_types::TxOut::from_rust(o) }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { crate::lightning::routing::utxo::UtxoLookupError::native_into(e) }).into() };
+ let mut local_a = match a { Ok(mut o) => crate::c_types::CResultTempl::ok( { crate::c_types::TxOut::from_rust(&o) }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { crate::lightning::routing::utxo::UtxoLookupError::native_into(e) }).into() };
UtxoResult::Sync (
local_a,
)
/// is unknown.
///
/// [`short_channel_id`]: https://github.com/lightning/bolts/blob/master/07-routing-gossip.md#definition-of-short_channel_id
- #[must_use]
pub get_utxo: extern "C" fn (this_arg: *const c_void, genesis_hash: *const [u8; 32], short_channel_id: u64) -> crate::lightning::routing::utxo::UtxoResult,
/// Frees any resources associated with this object given its this_arg pointer.
/// Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
}
unsafe impl Send for UtxoLookup {}
unsafe impl Sync for UtxoLookup {}
-#[no_mangle]
-pub(crate) extern "C" fn UtxoLookup_clone_fields(orig: &UtxoLookup) -> UtxoLookup {
+pub(crate) fn UtxoLookup_clone_fields(orig: &UtxoLookup) -> UtxoLookup {
UtxoLookup {
this_arg: orig.this_arg,
get_utxo: Clone::clone(&orig.get_utxo),
self
}
}
+impl core::ops::DerefMut for UtxoLookup {
+ fn deref_mut(&mut self) -> &mut Self {
+ self
+ }
+}
/// Calls the free function if one is set
#[no_mangle]
pub extern "C" fn UtxoLookup_free(this_ptr: UtxoLookup) { }