Mark BOLT 12 builders no-export in the new `OffersMessageFlow`
What changed, and why it matters
This commit only adds documentation comments to several Rust functions, explaining that they are not exposed to language bindings (such as Java, Swift, or Python wrappers) because the builder-pattern code relies on Rust-specific move semantics. There are no code behavior changes, no bug fixes, and no security-relevant modifications.
No action required. This is a documentation-only change with no security implications.
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 builder patterns don't map outside of move semantics. comments to eight public methods in lightning/src/offers/flow.rs that return BOLT 12 builder types. The methods themselves were already non-exported; the commit merely documents that fact consistently in the new OffersMessageFlow module. No logic, signatures, visibility, or safety properties changed.
Changed components
lightning/src/offers/flow.rsInspect captured patch +16 / −0
diff --git a/lightning/src/offers/flow.rs b/lightning/src/offers/flow.rs
index 74e5f02..88f0cc5 100644
--- a/lightning/src/offers/flow.rs
+++ b/lightning/src/offers/flow.rs
@@ -597,6 +597,8 @@ where
///
/// Returns an error if the parameterized [`Router`] is unable to create a blinded path for the offer.
///
+ /// This is not exported to bindings users as builder patterns don't map outside of move semantics.
+ ///
/// [`DefaultMessageRouter`]: crate::onion_message::messenger::DefaultMessageRouter
pub fn create_offer_builder<ES: Deref>(
&self, entropy_source: ES, peers: Vec<MessageForwardNode>,
@@ -618,6 +620,8 @@ where
/// This gives users full control over how the [`BlindedMessagePath`] is constructed,
/// including the option to omit it entirely.
///
+ /// This is not exported to bindings users as builder patterns don't map outside of move semantics.
+ ///
/// See [`Self::create_offer_builder`] for more details on usage.
pub fn create_offer_builder_using_router<ME: Deref, ES: Deref>(
&self, router: ME, entropy_source: ES, peers: Vec<MessageForwardNode>,
@@ -644,6 +648,8 @@ where
/// 2. Use [`Self::create_static_invoice_builder`] to create a [`StaticInvoice`] from this
/// [`Offer`] plus the returned [`Nonce`], and provide the static invoice to the
/// aforementioned always-online node.
+ ///
+ /// This is not exported to bindings users as builder patterns don't map outside of move semantics.
pub fn create_async_receive_offer_builder<ES: Deref>(
&self, entropy_source: ES, message_paths_to_always_online_node: Vec<BlindedMessagePath>,
) -> Result<(OfferBuilder<'_, DerivedMetadata, secp256k1::All>, Nonce), Bolt12SemanticError>
@@ -726,6 +732,8 @@ where
/// - `amount_msats` is invalid, or
/// - The parameterized [`Router`] is unable to create a blinded path for the refund.
///
+ /// This is not exported to bindings users as builder patterns don't map outside of move semantics.
+ ///
/// [`Event::PaymentFailed`]: crate::events::Event::PaymentFailed
/// [`RouteParameters::from_payment_params_and_value`]: crate::routing::router::RouteParameters::from_payment_params_and_value
pub fn create_refund_builder<ES: Deref>(
@@ -762,6 +770,8 @@ where
/// return an error if the provided [`MessageRouter`] fails to construct a valid
/// [`BlindedMessagePath`] for the refund.
///
+ /// This is not exported to bindings users as builder patterns don't map outside of move semantics.
+ ///
/// [`Refund`]: crate::offers::refund::Refund
/// [`BlindedMessagePath`]: crate::blinded_path::message::BlindedMessagePath
/// [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice
@@ -797,6 +807,8 @@ where
/// # Nonce
/// The nonce is used to create a unique [`InvoiceRequest::payer_metadata`] for the invoice request.
/// These will be used to verify the corresponding [`Bolt12Invoice`] when it is received.
+ ///
+ /// This is not exported to bindings users as builder patterns don't map outside of move semantics.
pub fn create_invoice_request_builder<'a>(
&'a self, offer: &'a Offer, nonce: Nonce, payment_id: PaymentId,
) -> Result<InvoiceRequestBuilder<'a, 'a, secp256k1::All>, Bolt12SemanticError> {
@@ -812,6 +824,8 @@ where
/// Creates a [`StaticInvoiceBuilder`] from the corresponding [`Offer`] and [`Nonce`] that were
/// created via [`Self::create_async_receive_offer_builder`].
+ ///
+ /// This is not exported to bindings users as builder patterns don't map outside of move semantics.
pub fn create_static_invoice_builder<'a, ES: Deref, R: Deref>(
&self, router: &R, entropy_source: ES, offer: &'a Offer, offer_nonce: Nonce,
payment_secret: PaymentSecret, relative_expiry_secs: u32,
@@ -884,6 +898,8 @@ where
///
/// Returns an error if the refund targets a different chain or if no valid
/// blinded path can be constructed.
+ ///
+ /// This is not exported to bindings users as builder patterns don't map outside of move semantics.
pub fn create_invoice_builder_from_refund<'a, ES: Deref, R: Deref, F>(
&'a self, router: &R, entropy_source: ES, refund: &'a Refund,
usable_channels: Vec<ChannelDetails>, get_payment_info: F,
Why this scored 15/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.