Skip to content

Commit 3f82fd6

Browse files
committed
Mark async traits and structs no-export
We do not currently support async traits or methods in our home-grown bindings logic, so here mark them no-export.
1 parent 2bf737c commit 3f82fd6

File tree

7 files changed

+37
-0
lines changed

7 files changed

+37
-0
lines changed

lightning/src/chain/chainmonitor.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -253,6 +253,8 @@ impl<ChannelSigner: EcdsaChannelSigner> Deref for LockedChannelMonitor<'_, Chann
253253

254254
/// An unconstructable [`Persist`]er which is used under the hood when you call
255255
/// [`ChainMonitor::new_async_beta`].
256+
///
257+
/// This is not exported to bindings users as async is not supported outside of Rust.
256258
pub struct AsyncPersister<
257259
K: Deref + MaybeSend + MaybeSync + 'static,
258260
S: FutureSpawner,
@@ -431,6 +433,8 @@ impl<
431433
/// [`MonitorUpdatingPersisterAsync`] and thus allows persistence to be completed async.
432434
///
433435
/// Note that async monitor updating is considered beta, and bugs may be triggered by its use.
436+
///
437+
/// This is not exported to bindings users as async is not supported outside of Rust.
434438
pub fn new_async_beta(
435439
chain_source: Option<C>, broadcaster: T, logger: L, feeest: F,
436440
persister: MonitorUpdatingPersisterAsync<K, S, L, ES, SP, T, F>, _entropy_source: ES,

lightning/src/events/bump_transaction/mod.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -353,6 +353,8 @@ pub struct CoinSelection {
353353
/// which can provide a default implementation of this trait when used with [`Wallet`].
354354
///
355355
/// For a synchronous version of this trait, see [`sync::CoinSelectionSourceSync`].
356+
///
357+
/// This is not exported to bindings users as async is only supported in Rust.
356358
pub trait CoinSelectionSource {
357359
/// Performs coin selection of a set of UTXOs, with at least 1 confirmation each, that are
358360
/// available to spend. Implementations are free to pick their coin selection algorithm of
@@ -404,6 +406,8 @@ pub trait CoinSelectionSource {
404406
/// provide a default implementation to [`CoinSelectionSource`].
405407
///
406408
/// For a synchronous version of this trait, see [`sync::WalletSourceSync`].
409+
///
410+
/// This is not exported to bindings users as async is only supported in Rust.
407411
pub trait WalletSource {
408412
/// Returns all UTXOs, with at least 1 confirmation each, that are available to spend.
409413
fn list_confirmed_utxos<'a>(&'a self) -> AsyncResult<'a, Vec<Utxo>, ()>;
@@ -424,6 +428,8 @@ pub trait WalletSource {
424428
/// spends may happen.
425429
///
426430
/// For a synchronous version of this wrapper, see [`sync::WalletSync`].
431+
///
432+
/// This is not exported to bindings users as async is only supported in Rust.
427433
pub struct Wallet<W: Deref + MaybeSync + MaybeSend, L: Deref + MaybeSync + MaybeSend>
428434
where
429435
W::Target: WalletSource + MaybeSend,
@@ -670,6 +676,8 @@ where
670676
///
671677
/// For a synchronous version of this handler, see [`sync::BumpTransactionEventHandlerSync`].
672678
///
679+
/// This is not exported to bindings users as async is only supported in Rust.
680+
///
673681
/// [`Event::BumpTransaction`]: crate::events::Event::BumpTransaction
674682
pub struct BumpTransactionEventHandler<B: Deref, C: Deref, SP: Deref, L: Deref>
675683
where

lightning/src/sign/mod.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1058,6 +1058,8 @@ pub trait SignerProvider {
10581058

10591059
/// A helper trait that describes an on-chain wallet capable of returning a (change) destination
10601060
/// script.
1061+
///
1062+
/// This is not exported to bindings users as async is only supported in Rust.
10611063
pub trait ChangeDestinationSource {
10621064
/// Returns a script pubkey which can be used as a change destination for
10631065
/// [`OutputSpender::spend_spendable_outputs`].

lightning/src/util/async_poll.rs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,27 +94,39 @@ pub(crate) fn dummy_waker() -> Waker {
9494

9595
#[cfg(feature = "std")]
9696
/// A type alias for a future that returns a result of type `T` or error `E`.
97+
///
98+
/// This is not exported to bindings users as async is only supported in Rust.
9799
pub type AsyncResult<'a, T, E> = Pin<Box<dyn Future<Output = Result<T, E>> + 'a + Send>>;
98100
#[cfg(not(feature = "std"))]
99101
/// A type alias for a future that returns a result of type `T` or error `E`.
102+
///
103+
/// This is not exported to bindings users as async is only supported in Rust.
100104
pub type AsyncResult<'a, T, E> = Pin<Box<dyn Future<Output = Result<T, E>> + 'a>>;
101105

102106
/// Marker trait to optionally implement `Sync` under std.
107+
///
108+
/// This is not exported to bindings users as async is only supported in Rust.
103109
#[cfg(feature = "std")]
104110
pub use core::marker::Sync as MaybeSync;
105111

106112
#[cfg(not(feature = "std"))]
107113
/// Marker trait to optionally implement `Sync` under std.
114+
///
115+
/// This is not exported to bindings users as async is only supported in Rust.
108116
pub trait MaybeSync {}
109117
#[cfg(not(feature = "std"))]
110118
impl<T> MaybeSync for T where T: ?Sized {}
111119

112120
/// Marker trait to optionally implement `Send` under std.
121+
///
122+
/// This is not exported to bindings users as async is only supported in Rust.
113123
#[cfg(feature = "std")]
114124
pub use core::marker::Send as MaybeSend;
115125

116126
#[cfg(not(feature = "std"))]
117127
/// Marker trait to optionally implement `Send` under std.
128+
///
129+
/// This is not exported to bindings users as async is only supported in Rust.
118130
pub trait MaybeSend {}
119131
#[cfg(not(feature = "std"))]
120132
impl<T> MaybeSend for T where T: ?Sized {}

lightning/src/util/native_async.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ use core::future::Future;
1818
use core::pin::Pin;
1919

2020
/// A generic trait which is able to spawn futures in the background.
21+
///
22+
/// This is not exported to bindings users as async is only supported in Rust.
2123
pub trait FutureSpawner: MaybeSend + MaybeSync + 'static {
2224
/// Spawns the given future as a background task.
2325
///

lightning/src/util/persist.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,7 @@ where
155155
}
156156
}
157157

158+
/// This is not exported to bindings users as async is only supported in Rust.
158159
impl<K: Deref> KVStore for KVStoreSyncWrapper<K>
159160
where
160161
K::Target: KVStoreSync,
@@ -213,6 +214,8 @@ where
213214
/// **Note:** Users migrating custom persistence backends from the pre-v0.0.117 `KVStorePersister`
214215
/// interface can use a concatenation of `[{primary_namespace}/[{secondary_namespace}/]]{key}` to
215216
/// recover a `key` compatible with the data model previously assumed by `KVStorePersister::persist`.
217+
///
218+
/// This is not exported to bindings users as async is only supported in Rust.
216219
pub trait KVStore {
217220
/// Returns the data stored for the given `primary_namespace`, `secondary_namespace`, and
218221
/// `key`.
@@ -717,6 +720,8 @@ where
717720
/// Unlike [`MonitorUpdatingPersister`], this does not implement [`Persist`], but is instead used
718721
/// directly by the [`ChainMonitor`] via [`ChainMonitor::new_async_beta`].
719722
///
723+
/// This is not exported to bindings users as async is only supported in Rust.
724+
///
720725
/// [`ChainMonitor`]: crate::chain::chainmonitor::ChainMonitor
721726
/// [`ChainMonitor::new_async_beta`]: crate::chain::chainmonitor::ChainMonitor::new_async_beta
722727
pub struct MonitorUpdatingPersisterAsync<

lightning/src/util/sweep.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -329,6 +329,8 @@ impl_writeable_tlv_based_enum!(OutputSpendStatus,
329329
/// required to give their chain data sources (i.e., [`Filter`] implementation) to the respective
330330
/// constructor.
331331
///
332+
/// This is not exported to bindings users as async is not supported outside of Rust.
333+
///
332334
/// [`Event::SpendableOutputs`]: crate::events::Event::SpendableOutputs
333335
pub struct OutputSweeper<B: Deref, D: Deref, E: Deref, F: Deref, K: Deref, L: Deref, O: Deref>
334336
where
@@ -979,6 +981,8 @@ where
979981
/// this [`OutputSweeperSync`], fetching an async [`OutputSweeper`] won't accomplish much, all
980982
/// the async methods will hang waiting on your sync [`KVStore`] and likely confuse your async
981983
/// runtime. This exists primarily for LDK-internal use, including outside of this crate.
984+
///
985+
/// This is not exported to bindings users as async is not supported outside of Rust.
982986
#[doc(hidden)]
983987
pub fn sweeper_async(
984988
&self,

0 commit comments

Comments
 (0)