Skip to content

Mark new types #[doc(hidden)] methods as bindings no-export #3272

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Aug 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions lightning-types/src/features.rs
Original file line number Diff line number Diff line change
Expand Up @@ -703,6 +703,8 @@ impl InitFeatures {
#[doc(hidden)]
/// Converts `InitFeatures` to `Features<C>`. Only known `InitFeatures` relevant to context `C`
/// are included in the result.
///
/// This is not exported to bindings users as it shouldn't be used outside of LDK
pub fn to_context<C: sealed::Context>(&self) -> Features<C> {
self.to_context_internal()
}
Expand All @@ -712,6 +714,8 @@ impl Bolt11InvoiceFeatures {
#[doc(hidden)]
/// Converts `Bolt11InvoiceFeatures` to `Features<C>`. Only known `Bolt11InvoiceFeatures` relevant to
/// context `C` are included in the result.
///
/// This is not exported to bindings users as it shouldn't be used outside of LDK
pub fn to_context<C: sealed::Context>(&self) -> Features<C> {
self.to_context_internal()
}
Expand All @@ -737,15 +741,19 @@ impl Bolt12InvoiceFeatures {
#[doc(hidden)]
/// Converts [`Bolt12InvoiceFeatures`] to [`Features<C>`]. Only known [`Bolt12InvoiceFeatures`]
/// relevant to context `C` are included in the result.
///
/// This is not exported to bindings users as it shouldn't be used outside of LDK
pub fn to_context<C: sealed::Context>(&self) -> Features<C> {
self.to_context_internal()
}
}

impl ChannelTypeFeatures {
#[doc(hidden)]
// Maps the relevant `InitFeatures` to `ChannelTypeFeatures`. Any unknown features to
// `ChannelTypeFeatures` are not included in the result.
/// Maps the relevant `InitFeatures` to `ChannelTypeFeatures`. Any unknown features to
/// `ChannelTypeFeatures` are not included in the result.
///
/// This is not exported to bindings users as it shouldn't be used outside of LDK
pub fn from_init(init: &InitFeatures) -> Self {
let mut ret = init.to_context_internal();
// ChannelTypeFeatures must only contain required bits, so we OR the required forms of all
Expand Down
3 changes: 3 additions & 0 deletions lightning/src/io/mod.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
pub use bitcoin::io::*;

/// Emulation of std::io::Cursor
///
/// This is not exported to bindings users as serialization is done via a bindings-specific
/// pipeline.
#[derive(Clone, Debug, Default, Eq, PartialEq)]
pub struct Cursor<T> {
inner: T,
Expand Down
Loading