X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=lightning-c-bindings%2Fsrc%2Fchain%2Fmod.rs;h=bce29715f7c16ae2764226dcfb66933e33c3c90d;hb=b2f0ccc7e0ef8b31567cb017d0b7cce9f7204803;hp=c3adcf6f7a6e967d9d2992f4675b23683a7b3abc;hpb=a132c4d7f8648278537854ae08a83d704853ed42;p=ldk-c-bindings diff --git a/lightning-c-bindings/src/chain/mod.rs b/lightning-c-bindings/src/chain/mod.rs index c3adcf6..bce2971 100644 --- a/lightning-c-bindings/src/chain/mod.rs +++ b/lightning-c-bindings/src/chain/mod.rs @@ -1,3 +1,11 @@ +// This file is Copyright its original authors, visible in version control +// history and in the source files from which this was generated. +// +// This file is licensed under the license available in the LICENSE or LICENSE.md +// file in the root of this repository or, if no such file exists, the same +// license as that which applies to the original source files from which this +// source was automatically generated. + //! Structs and traits which allow other parts of rust-lightning to interact with the blockchain. use std::ffi::c_void; @@ -10,8 +18,6 @@ pub mod channelmonitor; pub mod transaction; pub mod keysinterface; /// An error when accessing the chain via [`Access`]. -/// -/// [`Access`]: trait.Access.html #[must_use] #[derive(Clone)] #[repr(C)] @@ -71,8 +77,8 @@ pub struct Access { /// [`short_channel_id`]: https://github.com/lightningnetwork/lightning-rfc/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::c_types::derived::CResult_TxOutAccessErrorZ, -/// 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. + /// 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. pub free: Option, } unsafe impl Send for Access {} @@ -118,8 +124,8 @@ pub struct Listen { pub block_connected: extern "C" fn (this_arg: *const c_void, block: crate::c_types::u8slice, height: u32), /// Notifies the listener that a block was removed at the given height. pub block_disconnected: extern "C" fn (this_arg: *const c_void, header: *const [u8; 80], height: u32), -/// 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. + /// 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. pub free: Option, } @@ -171,9 +177,9 @@ impl Drop for Listen { /// funds in the channel. See [`ChannelMonitorUpdateErr`] for more details about how to handle /// multiple instances. /// -/// [`ChannelMonitor`]: channelmonitor/struct.ChannelMonitor.html -/// [`ChannelMonitorUpdateErr`]: channelmonitor/enum.ChannelMonitorUpdateErr.html -/// [`PermanentFailure`]: channelmonitor/enum.ChannelMonitorUpdateErr.html#variant.PermanentFailure +/// [`ChannelMonitor`]: channelmonitor::ChannelMonitor +/// [`ChannelMonitorUpdateErr`]: channelmonitor::ChannelMonitorUpdateErr +/// [`PermanentFailure`]: channelmonitor::ChannelMonitorUpdateErr::PermanentFailure #[repr(C)] pub struct Watch { /// An opaque pointer which is passed to your function implementations as an argument. @@ -185,9 +191,9 @@ pub struct Watch { /// with any spends of outputs returned by [`get_outputs_to_watch`]. In practice, this means /// calling [`block_connected`] and [`block_disconnected`] on the monitor. /// - /// [`get_outputs_to_watch`]: channelmonitor/struct.ChannelMonitor.html#method.get_outputs_to_watch - /// [`block_connected`]: channelmonitor/struct.ChannelMonitor.html#method.block_connected - /// [`block_disconnected`]: channelmonitor/struct.ChannelMonitor.html#method.block_disconnected + /// [`get_outputs_to_watch`]: channelmonitor::ChannelMonitor::get_outputs_to_watch + /// [`block_connected`]: channelmonitor::ChannelMonitor::block_connected + /// [`block_disconnected`]: channelmonitor::ChannelMonitor::block_disconnected #[must_use] pub watch_channel: extern "C" fn (this_arg: *const c_void, funding_txo: crate::chain::transaction::OutPoint, monitor: crate::chain::channelmonitor::ChannelMonitor) -> crate::c_types::derived::CResult_NoneChannelMonitorUpdateErrZ, /// Updates a channel identified by `funding_txo` by applying `update` to its monitor. @@ -195,16 +201,16 @@ pub struct Watch { /// Implementations must call [`update_monitor`] with the given update. See /// [`ChannelMonitorUpdateErr`] for invariants around returning an error. /// - /// [`update_monitor`]: channelmonitor/struct.ChannelMonitor.html#method.update_monitor - /// [`ChannelMonitorUpdateErr`]: channelmonitor/enum.ChannelMonitorUpdateErr.html + /// [`update_monitor`]: channelmonitor::ChannelMonitor::update_monitor + /// [`ChannelMonitorUpdateErr`]: channelmonitor::ChannelMonitorUpdateErr #[must_use] pub update_channel: extern "C" fn (this_arg: *const c_void, funding_txo: crate::chain::transaction::OutPoint, update: crate::chain::channelmonitor::ChannelMonitorUpdate) -> crate::c_types::derived::CResult_NoneChannelMonitorUpdateErrZ, /// Returns any monitor events since the last call. Subsequent calls must only return new /// events. #[must_use] pub release_pending_monitor_events: extern "C" fn (this_arg: *const c_void) -> crate::c_types::derived::CVec_MonitorEventZ, -/// 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. + /// 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. pub free: Option, } unsafe impl Send for Watch {} @@ -261,11 +267,10 @@ impl Drop for Watch { /// /// Note that use as part of a [`Watch`] implementation involves reentrancy. Therefore, the `Filter` /// should not block on I/O. Implementations should instead queue the newly monitored data to be -/// processed later. Then, in order to block until the data has been processed, any `Watch` +/// processed later. Then, in order to block until the data has been processed, any [`Watch`] /// invocation that has called the `Filter` must return [`TemporaryFailure`]. /// -/// [`Watch`]: trait.Watch.html -/// [`TemporaryFailure`]: channelmonitor/enum.ChannelMonitorUpdateErr.html#variant.TemporaryFailure +/// [`TemporaryFailure`]: channelmonitor::ChannelMonitorUpdateErr::TemporaryFailure /// [BIP 157]: https://github.com/bitcoin/bips/blob/master/bip-0157.mediawiki /// [BIP 158]: https://github.com/bitcoin/bips/blob/master/bip-0158.mediawiki #[repr(C)] @@ -279,8 +284,8 @@ pub struct Filter { /// Registers interest in spends of a transaction output identified by `outpoint` having /// `script_pubkey` as the spending condition. pub register_output: extern "C" fn (this_arg: *const c_void, outpoint: &crate::chain::transaction::OutPoint, script_pubkey: crate::c_types::u8slice), -/// 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. + /// 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. pub free: Option, } unsafe impl Send for Filter {}