Mark async traits and structs no-export
What changed, and why it matters
This commit only adds documentation comments to Rust structs, traits, and type aliases explaining that they are not exported to language bindings because async support is not available outside Rust. There are no code behavior changes, no bug fixes, and no security patches. It is a documentation-only change for bindings generation tooling.
No security action required. Treat as a normal documentation/maintenance commit.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The diff adds /// This is not exported to bindings users as async is only supported in Rust. (or similar wording) to public async traits, structs, and type aliases across seven files. No signatures, visibility, logic, or unsafe code are modified. The annotations are consumed by LDK’s home-grown bindings generator to exclude async items from non-Rust language bindings. This is purely a metadata/documentation change.
Changed components
lightning/src/chain/chainmonitor.rslightning/src/events/bump_transaction/mod.rslightning/src/sign/mod.rslightning/src/util/async_poll.rslightning/src/util/native_async.rslightning/src/util/persist.rslightning/src/util/sweep.rsInspect captured patch +37 / −0
diff --git a/lightning/src/chain/chainmonitor.rs b/lightning/src/chain/chainmonitor.rs
index 62b6c9f..d8d6c90 100644
--- a/lightning/src/chain/chainmonitor.rs
+++ b/lightning/src/chain/chainmonitor.rs
@@ -253,6 +253,8 @@ impl<ChannelSigner: EcdsaChannelSigner> Deref for LockedChannelMonitor<'_, Chann
/// An unconstructable [`Persist`]er which is used under the hood when you call
/// [`ChainMonitor::new_async_beta`].
+///
+/// This is not exported to bindings users as async is not supported outside of Rust.
pub struct AsyncPersister<
K: Deref + MaybeSend + MaybeSync + 'static,
S: FutureSpawner,
@@ -431,6 +433,8 @@ impl<
/// [`MonitorUpdatingPersisterAsync`] and thus allows persistence to be completed async.
///
/// Note that async monitor updating is considered beta, and bugs may be triggered by its use.
+ ///
+ /// This is not exported to bindings users as async is not supported outside of Rust.
pub fn new_async_beta(
chain_source: Option<C>, broadcaster: T, logger: L, feeest: F,
persister: MonitorUpdatingPersisterAsync<K, S, L, ES, SP, T, F>, _entropy_source: ES,
diff --git a/lightning/src/events/bump_transaction/mod.rs b/lightning/src/events/bump_transaction/mod.rs
index ec55c92..58a9b6a 100644
--- a/lightning/src/events/bump_transaction/mod.rs
+++ b/lightning/src/events/bump_transaction/mod.rs
@@ -353,6 +353,8 @@ pub struct CoinSelection {
/// which can provide a default implementation of this trait when used with [`Wallet`].
///
/// For a synchronous version of this trait, see [`sync::CoinSelectionSourceSync`].
+///
+/// This is not exported to bindings users as async is only supported in Rust.
pub trait CoinSelectionSource {
/// Performs coin selection of a set of UTXOs, with at least 1 confirmation each, that are
/// available to spend. Implementations are free to pick their coin selection algorithm of
@@ -404,6 +406,8 @@ pub trait CoinSelectionSource {
/// provide a default implementation to [`CoinSelectionSource`].
///
/// For a synchronous version of this trait, see [`sync::WalletSourceSync`].
+///
+/// This is not exported to bindings users as async is only supported in Rust.
pub trait WalletSource {
/// Returns all UTXOs, with at least 1 confirmation each, that are available to spend.
fn list_confirmed_utxos<'a>(&'a self) -> AsyncResult<'a, Vec<Utxo>, ()>;
@@ -424,6 +428,8 @@ pub trait WalletSource {
/// spends may happen.
///
/// For a synchronous version of this wrapper, see [`sync::WalletSync`].
+///
+/// This is not exported to bindings users as async is only supported in Rust.
pub struct Wallet<W: Deref + MaybeSync + MaybeSend, L: Deref + MaybeSync + MaybeSend>
where
W::Target: WalletSource + MaybeSend,
@@ -670,6 +676,8 @@ where
///
/// For a synchronous version of this handler, see [`sync::BumpTransactionEventHandlerSync`].
///
+/// This is not exported to bindings users as async is only supported in Rust.
+///
/// [`Event::BumpTransaction`]: crate::events::Event::BumpTransaction
pub struct BumpTransactionEventHandler<B: Deref, C: Deref, SP: Deref, L: Deref>
where
diff --git a/lightning/src/sign/mod.rs b/lightning/src/sign/mod.rs
index 88a9f32..8a5aceb 100644
--- a/lightning/src/sign/mod.rs
+++ b/lightning/src/sign/mod.rs
@@ -1058,6 +1058,8 @@ pub trait SignerProvider {
/// A helper trait that describes an on-chain wallet capable of returning a (change) destination
/// script.
+///
+/// This is not exported to bindings users as async is only supported in Rust.
pub trait ChangeDestinationSource {
/// Returns a script pubkey which can be used as a change destination for
/// [`OutputSpender::spend_spendable_outputs`].
diff --git a/lightning/src/util/async_poll.rs b/lightning/src/util/async_poll.rs
index 7161bc7..eefa40d 100644
--- a/lightning/src/util/async_poll.rs
+++ b/lightning/src/util/async_poll.rs
@@ -94,27 +94,39 @@ pub(crate) fn dummy_waker() -> Waker {
#[cfg(feature = "std")]
/// A type alias for a future that returns a result of type `T` or error `E`.
+///
+/// This is not exported to bindings users as async is only supported in Rust.
pub type AsyncResult<'a, T, E> = Pin<Box<dyn Future<Output = Result<T, E>> + 'a + Send>>;
#[cfg(not(feature = "std"))]
/// A type alias for a future that returns a result of type `T` or error `E`.
+///
+/// This is not exported to bindings users as async is only supported in Rust.
pub type AsyncResult<'a, T, E> = Pin<Box<dyn Future<Output = Result<T, E>> + 'a>>;
/// Marker trait to optionally implement `Sync` under std.
+///
+/// This is not exported to bindings users as async is only supported in Rust.
#[cfg(feature = "std")]
pub use core::marker::Sync as MaybeSync;
#[cfg(not(feature = "std"))]
/// Marker trait to optionally implement `Sync` under std.
+///
+/// This is not exported to bindings users as async is only supported in Rust.
pub trait MaybeSync {}
#[cfg(not(feature = "std"))]
impl<T> MaybeSync for T where T: ?Sized {}
/// Marker trait to optionally implement `Send` under std.
+///
+/// This is not exported to bindings users as async is only supported in Rust.
#[cfg(feature = "std")]
pub use core::marker::Send as MaybeSend;
#[cfg(not(feature = "std"))]
/// Marker trait to optionally implement `Send` under std.
+///
+/// This is not exported to bindings users as async is only supported in Rust.
pub trait MaybeSend {}
#[cfg(not(feature = "std"))]
impl<T> MaybeSend for T where T: ?Sized {}
diff --git a/lightning/src/util/native_async.rs b/lightning/src/util/native_async.rs
index dc26cb4..886146e 100644
--- a/lightning/src/util/native_async.rs
+++ b/lightning/src/util/native_async.rs
@@ -18,6 +18,8 @@ use core::future::Future;
use core::pin::Pin;
/// A generic trait which is able to spawn futures in the background.
+///
+/// This is not exported to bindings users as async is only supported in Rust.
pub trait FutureSpawner: MaybeSend + MaybeSync + 'static {
/// Spawns the given future as a background task.
///
diff --git a/lightning/src/util/persist.rs b/lightning/src/util/persist.rs
index 49addd7..7be957a 100644
--- a/lightning/src/util/persist.rs
+++ b/lightning/src/util/persist.rs
@@ -155,6 +155,7 @@ where
}
}
+/// This is not exported to bindings users as async is only supported in Rust.
impl<K: Deref> KVStore for KVStoreSyncWrapper<K>
where
K::Target: KVStoreSync,
@@ -213,6 +214,8 @@ where
/// **Note:** Users migrating custom persistence backends from the pre-v0.0.117 `KVStorePersister`
/// interface can use a concatenation of `[{primary_namespace}/[{secondary_namespace}/]]{key}` to
/// recover a `key` compatible with the data model previously assumed by `KVStorePersister::persist`.
+///
+/// This is not exported to bindings users as async is only supported in Rust.
pub trait KVStore {
/// Returns the data stored for the given `primary_namespace`, `secondary_namespace`, and
/// `key`.
@@ -717,6 +720,8 @@ where
/// Unlike [`MonitorUpdatingPersister`], this does not implement [`Persist`], but is instead used
/// directly by the [`ChainMonitor`] via [`ChainMonitor::new_async_beta`].
///
+/// This is not exported to bindings users as async is only supported in Rust.
+///
/// [`ChainMonitor`]: crate::chain::chainmonitor::ChainMonitor
/// [`ChainMonitor::new_async_beta`]: crate::chain::chainmonitor::ChainMonitor::new_async_beta
pub struct MonitorUpdatingPersisterAsync<
diff --git a/lightning/src/util/sweep.rs b/lightning/src/util/sweep.rs
index 95a7585..a6b11ac 100644
--- a/lightning/src/util/sweep.rs
+++ b/lightning/src/util/sweep.rs
@@ -329,6 +329,8 @@ impl_writeable_tlv_based_enum!(OutputSpendStatus,
/// required to give their chain data sources (i.e., [`Filter`] implementation) to the respective
/// constructor.
///
+/// This is not exported to bindings users as async is not supported outside of Rust.
+///
/// [`Event::SpendableOutputs`]: crate::events::Event::SpendableOutputs
pub struct OutputSweeper<B: Deref, D: Deref, E: Deref, F: Deref, K: Deref, L: Deref, O: Deref>
where
@@ -979,6 +981,8 @@ where
/// this [`OutputSweeperSync`], fetching an async [`OutputSweeper`] won't accomplish much, all
/// the async methods will hang waiting on your sync [`KVStore`] and likely confuse your async
/// runtime. This exists primarily for LDK-internal use, including outside of this crate.
+ ///
+ /// This is not exported to bindings users as async is not supported outside of Rust.
#[doc(hidden)]
pub fn sweeper_async(
&self,
Why this scored 19/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.