Make `util::async_poll` public
What changed, and why it matters
This commit changes an internal Rust utility module from private to public so that other parts of the library can use its types. It is a routine API-visibility change with no security implications.
No security action needed. Review as normal API-export change.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The commit re-exports lightning::util::async_poll as a public module (pub mod async_poll) instead of a crate-private one (pub(crate) mod async_poll). It also adds missing doc comments to the public AsyncResult, MaybeSync, and MaybeSend items. The change is purely about Rust module visibility and documentation; no logic, bounds, or behavior changes.
Changed components
lightning/src/util/async_poll.rslightning/src/util/mod.rsInspect captured patch +8 / −4
diff --git a/lightning/src/util/async_poll.rs b/lightning/src/util/async_poll.rs
index 7c070f3..3edfd52 100644
--- a/lightning/src/util/async_poll.rs
+++ b/lightning/src/util/async_poll.rs
@@ -92,25 +92,29 @@ pub(crate) fn dummy_waker() -> Waker {
unsafe { Waker::from_raw(RawWaker::new(core::ptr::null(), &DUMMY_WAKER_VTABLE)) }
}
-/// A type alias for a future that returns a result of type T.
#[cfg(feature = "std")]
+/// A type alias for a future that returns a result of type T.
pub type AsyncResult<'a, T> = Pin<Box<dyn Future<Output = Result<T, ()>> + 'a + Send>>;
#[cfg(not(feature = "std"))]
+/// A type alias for a future that returns a result of type T.
pub type AsyncResult<'a, T> = Pin<Box<dyn Future<Output = Result<T, ()>> + 'a>>;
-// Marker trait to optionally implement `Sync` under std.
+/// Marker trait to optionally implement `Sync` under std.
#[cfg(feature = "std")]
pub use core::marker::Sync as MaybeSync;
#[cfg(not(feature = "std"))]
+/// Marker trait to optionally implement `Sync` under std.
pub trait MaybeSync {}
#[cfg(not(feature = "std"))]
impl<T> MaybeSync for T where T: ?Sized {}
-// Marker trait to optionally implement `Send` under std.
+/// Marker trait to optionally implement `Send` under std.
#[cfg(feature = "std")]
pub use core::marker::Send as MaybeSend;
+
#[cfg(not(feature = "std"))]
+/// Marker trait to optionally implement `Send` under std.
pub trait MaybeSend {}
#[cfg(not(feature = "std"))]
impl<T> MaybeSend for T where T: ?Sized {}
diff --git a/lightning/src/util/mod.rs b/lightning/src/util/mod.rs
index 968f822..dcbea90 100644
--- a/lightning/src/util/mod.rs
+++ b/lightning/src/util/mod.rs
@@ -20,6 +20,7 @@ pub mod mut_global;
pub mod anchor_channel_reserves;
+pub mod async_poll;
#[cfg(fuzzing)]
pub mod base32;
#[cfg(not(fuzzing))]
@@ -33,7 +34,6 @@ pub mod ser;
pub mod sweep;
pub mod wakers;
-pub(crate) mod async_poll;
pub(crate) mod atomic_counter;
pub(crate) mod byte_utils;
pub mod hash_tables;
Why this scored 16/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.