X-Git-Url: http://git.bitcoin.ninja/index.cgi?p=ldk-c-bindings;a=blobdiff_plain;f=lightning-c-bindings%2Fsrc%2Flightning%2Fchain%2Fchaininterface.rs;fp=lightning-c-bindings%2Fsrc%2Flightning%2Fchain%2Fchaininterface.rs;h=0dc8d6c52926fd16390787229d4816bbd14bdb85;hp=e27203a87238bee65f1a8c0ee56b4c29720a76ed;hb=3e46e1794f14640e35f09cc6da4169c152de34ce;hpb=53e91fd10d98313d2175470416f635d080e67e65 diff --git a/lightning-c-bindings/src/lightning/chain/chaininterface.rs b/lightning-c-bindings/src/lightning/chain/chaininterface.rs index e27203a..0dc8d6c 100644 --- a/lightning-c-bindings/src/lightning/chain/chaininterface.rs +++ b/lightning-c-bindings/src/lightning/chain/chaininterface.rs @@ -13,6 +13,7 @@ //! disconnections, transaction broadcasting, and feerate information requests. use alloc::str::FromStr; +use alloc::string::String; use core::ffi::c_void; use core::convert::Infallible; use bitcoin::hashes::Hash; @@ -46,8 +47,7 @@ pub struct BroadcasterInterface { } unsafe impl Send for BroadcasterInterface {} unsafe impl Sync for BroadcasterInterface {} -#[no_mangle] -pub(crate) extern "C" fn BroadcasterInterface_clone_fields(orig: &BroadcasterInterface) -> BroadcasterInterface { +pub(crate) fn BroadcasterInterface_clone_fields(orig: &BroadcasterInterface) -> BroadcasterInterface { BroadcasterInterface { this_arg: orig.this_arg, broadcast_transactions: Clone::clone(&orig.broadcast_transactions), @@ -71,6 +71,11 @@ impl core::ops::Deref for BroadcasterInterface { self } } +impl core::ops::DerefMut for BroadcasterInterface { + fn deref_mut(&mut self) -> &mut Self { + self + } +} /// Calls the free function if one is set #[no_mangle] pub extern "C" fn BroadcasterInterface_free(this_ptr: BroadcasterInterface) { } @@ -210,8 +215,7 @@ pub struct FeeEstimator { } unsafe impl Send for FeeEstimator {} unsafe impl Sync for FeeEstimator {} -#[no_mangle] -pub(crate) extern "C" fn FeeEstimator_clone_fields(orig: &FeeEstimator) -> FeeEstimator { +pub(crate) fn FeeEstimator_clone_fields(orig: &FeeEstimator) -> FeeEstimator { FeeEstimator { this_arg: orig.this_arg, get_est_sat_per_1000_weight: Clone::clone(&orig.get_est_sat_per_1000_weight), @@ -235,6 +239,11 @@ impl core::ops::Deref for FeeEstimator { self } } +impl core::ops::DerefMut for FeeEstimator { + fn deref_mut(&mut self) -> &mut Self { + self + } +} /// Calls the free function if one is set #[no_mangle] pub extern "C" fn FeeEstimator_free(this_ptr: FeeEstimator) { }