Merge pull request #2110 from munjesi/docs_fixes

Replacing (C-not exported) in the docs
This commit is contained in:
Matt Corallo 2023-03-27 18:12:00 +00:00 committed by GitHub
commit 2223e92ac6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
21 changed files with 88 additions and 78 deletions

View File

@ -164,7 +164,7 @@ where U::Target: UtxoLookup, L::Target: Logger {
}
}
/// (C-not exported) as the bindings concretize everything and have constructors for us
/// This is not exported to bindings users as the bindings concretize everything and have constructors for us
impl<P: Deref<Target = P2PGossipSync<G, U, L>>, G: Deref<Target = NetworkGraph<L>>, U: Deref, L: Deref>
GossipSync<P, &RapidGossipSync<G, L>, G, U, L>
where
@ -177,7 +177,7 @@ where
}
}
/// (C-not exported) as the bindings concretize everything and have constructors for us
/// This is not exported to bindings users as the bindings concretize everything and have constructors for us
impl<'a, R: Deref<Target = RapidGossipSync<G, L>>, G: Deref<Target = NetworkGraph<L>>, L: Deref>
GossipSync<
&P2PGossipSync<G, &'a (dyn UtxoLookup + Send + Sync), L>,
@ -195,7 +195,7 @@ where
}
}
/// (C-not exported) as the bindings concretize everything and have constructors for us
/// This is not exported to bindings users as the bindings concretize everything and have constructors for us
impl<'a, L: Deref>
GossipSync<
&P2PGossipSync<&'a NetworkGraph<L>, &'a (dyn UtxoLookup + Send + Sync), L>,

View File

@ -216,7 +216,7 @@ pub const DEFAULT_MIN_FINAL_CLTV_EXPIRY_DELTA: u64 = 18;
/// * `H`: exactly one `PaymentHash`
/// * `T`: the timestamp is set
///
/// (C-not exported) as we likely need to manually select one set of boolean type parameters.
/// This is not exported to bindings users as we likely need to manually select one set of boolean type parameters.
#[derive(Eq, PartialEq, Debug, Clone)]
pub struct InvoiceBuilder<D: tb::Bool, H: tb::Bool, T: tb::Bool, C: tb::Bool, S: tb::Bool> {
currency: Currency,
@ -247,7 +247,7 @@ pub struct Invoice {
/// Represents the description of an invoice which has to be either a directly included string or
/// a hash of a description provided out of band.
///
/// (C-not exported) As we don't have a good way to map the reference lifetimes making this
/// This is not exported to bindings users as we don't have a good way to map the reference lifetimes making this
/// practically impossible to use safely in languages like C.
#[derive(Eq, PartialEq, Debug, Clone)]
pub enum InvoiceDescription<'f> {
@ -297,7 +297,7 @@ pub struct RawInvoice {
/// Data of the `RawInvoice` that is encoded in the human readable part
///
/// (C-not exported) As we don't yet support `Option<Enum>`
/// This is not exported to bindings users as we don't yet support `Option<Enum>`
#[derive(Eq, PartialEq, Debug, Clone, Hash)]
pub struct RawHrp {
/// The currency deferred from the 3rd and 4th character of the bech32 transaction
@ -357,7 +357,7 @@ impl SiPrefix {
/// Returns all enum variants of `SiPrefix` sorted in descending order of their associated
/// multiplier.
///
/// (C-not exported) As we don't yet support a slice of enums, and also because this function
/// This is not exported to bindings users as we don't yet support a slice of enums, and also because this function
/// isn't the most critical to expose.
pub fn values_desc() -> &'static [SiPrefix] {
use crate::SiPrefix::*;
@ -387,7 +387,7 @@ pub enum Currency {
/// Tagged field which may have an unknown tag
///
/// (C-not exported) as we don't currently support TaggedField
/// This is not exported to bindings users as we don't currently support TaggedField
#[derive(Clone, Debug, Hash, Eq, PartialEq)]
pub enum RawTaggedField {
/// Parsed tagged field with known tag
@ -400,7 +400,7 @@ pub enum RawTaggedField {
///
/// For descriptions of the enum values please refer to the enclosed type's docs.
///
/// (C-not exported) As we don't yet support enum variants with the same name the struct contained
/// This is not exported to bindings users as we don't yet support enum variants with the same name the struct contained
/// in the variant.
#[allow(missing_docs)]
#[derive(Clone, Debug, Hash, Eq, PartialEq)]
@ -419,7 +419,7 @@ pub enum TaggedField {
/// SHA-256 hash
#[derive(Clone, Debug, Hash, Eq, PartialEq)]
pub struct Sha256(/// (C-not exported) as the native hash types are not currently mapped
pub struct Sha256(/// This is not exported to bindings users as the native hash types are not currently mapped
pub sha256::Hash);
/// Description string
@ -885,7 +885,7 @@ impl RawInvoice {
/// of type `E`. Since the signature of a `SignedRawInvoice` is not required to be valid there
/// are no constraints regarding the validity of the produced signature.
///
/// (C-not exported) As we don't currently support passing function pointers into methods
/// This is not exported to bindings users as we don't currently support passing function pointers into methods
/// explicitly.
pub fn sign<F, E>(self, sign_method: F) -> Result<SignedRawInvoice, E>
where F: FnOnce(&Message) -> Result<RecoverableSignature, E>
@ -904,7 +904,7 @@ impl RawInvoice {
/// Returns an iterator over all tagged fields with known semantics.
///
/// (C-not exported) As there is not yet a manual mapping for a FilterMap
/// This is not exported to bindings users as there is not yet a manual mapping for a FilterMap
pub fn known_tagged_fields(&self)
-> FilterMap<Iter<RawTaggedField>, fn(&RawTaggedField) -> Option<&TaggedField>>
{
@ -953,7 +953,7 @@ impl RawInvoice {
find_extract!(self.known_tagged_fields(), TaggedField::Features(ref x), x)
}
/// (C-not exported) as we don't support Vec<&NonOpaqueType>
/// This is not exported to bindings users as we don't support Vec<&NonOpaqueType>
pub fn fallbacks(&self) -> Vec<&Fallback> {
find_all_extract!(self.known_tagged_fields(), TaggedField::Fallback(ref x), x).collect()
}
@ -1182,7 +1182,7 @@ impl Invoice {
/// Returns an iterator over all tagged fields of this Invoice.
///
/// (C-not exported) As there is not yet a manual mapping for a FilterMap
/// This is not exported to bindings users as there is not yet a manual mapping for a FilterMap
pub fn tagged_fields(&self)
-> FilterMap<Iter<RawTaggedField>, fn(&RawTaggedField) -> Option<&TaggedField>> {
self.signed_invoice.raw_invoice().known_tagged_fields()
@ -1195,7 +1195,7 @@ impl Invoice {
/// Return the description or a hash of it for longer ones
///
/// (C-not exported) because we don't yet export InvoiceDescription
/// This is not exported to bindings users because we don't yet export InvoiceDescription
pub fn description(&self) -> InvoiceDescription {
if let Some(direct) = self.signed_invoice.description() {
return InvoiceDescription::Direct(direct);
@ -1265,7 +1265,7 @@ impl Invoice {
/// Returns a list of all fallback addresses
///
/// (C-not exported) as we don't support Vec<&NonOpaqueType>
/// This is not exported to bindings users as we don't support Vec<&NonOpaqueType>
pub fn fallbacks(&self) -> Vec<&Fallback> {
self.signed_invoice.fallbacks()
}

View File

@ -124,7 +124,7 @@ impl Display for SignedRawInvoice {
}
}
/// (C-not exported)
/// This is not exported to bindings users
impl Display for RawHrp {
fn fmt(&self, f: &mut Formatter) -> Result<(), fmt::Error> {
let amount = match self.raw_amount {

View File

@ -146,7 +146,7 @@ impl<NG: Deref<Target=NetworkGraph<L>>, L: Deref> RapidGossipSync<NG, L> where L
/// Gets a reference to the underlying [`NetworkGraph`] which was provided in
/// [`RapidGossipSync::new`].
///
/// (C-not exported) as bindings don't support a reference-to-a-reference yet
/// This is not exported to bindings users as bindings don't support a reference-to-a-reference yet
pub fn network_graph(&self) -> &NG {
&self.network_graph
}

View File

@ -55,7 +55,7 @@ use crate::util::invoice::construct_invoice_preimage;
/// Used as initial key material, to be expanded into multiple secret keys (but not to be used
/// directly). This is used within LDK to encrypt/decrypt inbound payment data.
///
/// (C-not exported) as we just use `[u8; 32]` directly
/// This is not exported to bindings users as we just use `[u8; 32]` directly
#[derive(Hash, Copy, Clone, PartialEq, Eq, Debug)]
pub struct KeyMaterial(pub [u8; 32]);

View File

@ -66,7 +66,9 @@ impl OutPoint {
}
/// Converts this OutPoint into the OutPoint field as used by rust-bitcoin
/// (C-not exported) as the same type is used universally in the C bindings for all outpoints
///
/// This is not exported to bindings users as the same type is used universally in the C bindings
/// for all outpoints
pub fn into_bitcoin_outpoint(self) -> BitcoinOutPoint {
BitcoinOutPoint {
txid: self.txid,

View File

@ -1272,7 +1272,7 @@ impl CommitmentTransaction {
///
/// Only include HTLCs that are above the dust limit for the channel.
///
/// (C-not exported) due to the generic though we likely should expose a version without
/// This is not exported to bindings users due to the generic though we likely should expose a version without
pub fn new_with_auxiliary_htlc_data<T>(commitment_number: u64, to_broadcaster_value_sat: u64, to_countersignatory_value_sat: u64, opt_anchors: bool, broadcaster_funding_key: PublicKey, countersignatory_funding_key: PublicKey, keys: TxCreationKeys, feerate_per_kw: u32, htlcs_with_aux: &mut Vec<(HTLCOutputInCommitment, T)>, channel_parameters: &DirectedChannelTransactionParameters) -> CommitmentTransaction {
// Sort outputs and populate output indices while keeping track of the auxiliary data
let (outputs, htlcs) = Self::internal_build_outputs(&keys, to_broadcaster_value_sat, to_countersignatory_value_sat, htlcs_with_aux, channel_parameters, opt_anchors, &broadcaster_funding_key, &countersignatory_funding_key).unwrap();
@ -1298,7 +1298,7 @@ impl CommitmentTransaction {
/// Use non-zero fee anchors
///
/// (C-not exported) due to move, and also not likely to be useful for binding users
/// This is not exported to bindings users due to move, and also not likely to be useful for binding users
pub fn with_non_zero_fee_anchors(mut self) -> Self {
self.opt_non_zero_fee_anchors = Some(());
self
@ -1479,7 +1479,7 @@ impl CommitmentTransaction {
/// which were included in this commitment transaction in output order.
/// The transaction index is always populated.
///
/// (C-not exported) as we cannot currently convert Vec references to/from C, though we should
/// This is not exported to bindings users as we cannot currently convert Vec references to/from C, though we should
/// expose a less effecient version which creates a Vec of references in the future.
pub fn htlcs(&self) -> &Vec<HTLCOutputInCommitment> {
&self.htlcs

View File

@ -199,7 +199,8 @@ struct ClaimableHTLC {
}
/// A payment identifier used to uniquely identify a payment to LDK.
/// (C-not exported) as we just use [u8; 32] directly
///
/// This is not exported to bindings users as we just use [u8; 32] directly
#[derive(Hash, Copy, Clone, PartialEq, Eq, Debug)]
pub struct PaymentId(pub [u8; 32]);
@ -217,7 +218,8 @@ impl Readable for PaymentId {
}
/// An identifier used to uniquely identify an intercepted HTLC to LDK.
/// (C-not exported) as we just use [u8; 32] directly
///
/// This is not exported to bindings users as we just use [u8; 32] directly
#[derive(Hash, Copy, Clone, PartialEq, Eq, Debug)]
pub struct InterceptId(pub [u8; 32]);
@ -569,7 +571,7 @@ struct PendingInboundPayment {
/// or, respectively, [`Router`] for its router, but this type alias chooses the concrete types
/// of [`KeysManager`] and [`DefaultRouter`].
///
/// (C-not exported) as Arcs don't make sense in bindings
/// This is not exported to bindings users as Arcs don't make sense in bindings
pub type SimpleArcChannelManager<M, T, F, L> = ChannelManager<
Arc<M>,
Arc<T>,
@ -595,7 +597,7 @@ pub type SimpleArcChannelManager<M, T, F, L> = ChannelManager<
/// or, respectively, [`Router`] for its router, but this type alias chooses the concrete types
/// of [`KeysManager`] and [`DefaultRouter`].
///
/// (C-not exported) as Arcs don't make sense in bindings
/// This is not exported to bindings users as Arcs don't make sense in bindings
pub type SimpleRefChannelManager<'a, 'b, 'c, 'd, 'e, 'f, 'g, 'h, M, T, F, L> = ChannelManager<&'a M, &'b T, &'c KeysManager, &'c KeysManager, &'c KeysManager, &'d F, &'e DefaultRouter<&'f NetworkGraph<&'g L>, &'g L, &'h Mutex<ProbabilisticScorer<&'f NetworkGraph<&'g L>, &'g L>>>, &'g L>;
/// Manager which keeps track of a number of channels and sends messages to the appropriate
@ -7236,7 +7238,7 @@ where
/// In such cases the latest local transactions will be sent to the tx_broadcaster included in
/// this struct.
///
/// (C-not exported) because we have no HashMap bindings
/// This is not exported to bindings users because we have no HashMap bindings
pub channel_monitors: HashMap<OutPoint, &'a mut ChannelMonitor<<SP::Target as SignerProvider>::Signer>>,
}

View File

@ -393,7 +393,7 @@ mod sealed {
/// Tracks the set of features which a node implements, templated by the context in which it
/// appears.
///
/// (C-not exported) as we map the concrete feature types below directly instead
/// This is not exported to bindings users as we map the concrete feature types below directly instead
#[derive(Eq)]
pub struct Features<T: sealed::Context> {
/// Note that, for convenience, flags is LITTLE endian (despite being big-endian on the wire)
@ -622,7 +622,8 @@ impl<T: sealed::Context> Features<T> {
/// Create a Features given a set of flags, in little-endian. This is in reverse byte order from
/// most on-the-wire encodings.
/// (C-not exported) as we don't support export across multiple T
///
/// This is not exported to bindings users as we don't support export across multiple T
pub fn from_le_bytes(flags: Vec<u8>) -> Features<T> {
Features {
flags,

View File

@ -70,15 +70,18 @@ mod shutdown_tests;
pub use self::peer_channel_encryptor::LN_MAX_MSG_LEN;
/// payment_hash type, use to cross-lock hop
/// (C-not exported) as we just use [u8; 32] directly
///
/// This is not exported to bindings users as we just use [u8; 32] directly
#[derive(Hash, Copy, Clone, PartialEq, Eq, Debug)]
pub struct PaymentHash(pub [u8; 32]);
/// payment_preimage type, use to route payment between hop
/// (C-not exported) as we just use [u8; 32] directly
///
/// This is not exported to bindings users as we just use [u8; 32] directly
#[derive(Hash, Copy, Clone, PartialEq, Eq, Debug)]
pub struct PaymentPreimage(pub [u8; 32]);
/// payment_secret type, use to authenticate sender to the receiver and tie MPP HTLCs together
/// (C-not exported) as we just use [u8; 32] directly
///
/// This is not exported to bindings users as we just use [u8; 32] directly
#[derive(Hash, Copy, Clone, PartialEq, Eq, Debug)]
pub struct PaymentSecret(pub [u8; 32]);

View File

@ -939,7 +939,7 @@ pub struct CommitmentUpdate {
/// [`OptionalField`] simply gets `Present` if there are enough bytes to read into it), we have a
/// separate enum type for them.
///
/// (C-not exported) due to a free generic in `T`
/// This is not exported to bindings users due to a free generic in `T`
#[derive(Clone, Debug, PartialEq, Eq)]
pub enum OptionalField<T> {
/// Optional field is included in message

View File

@ -522,7 +522,7 @@ impl Peer {
/// SimpleRefPeerManager is the more appropriate type. Defining these type aliases prevents
/// issues such as overly long function definitions.
///
/// (C-not exported) as `Arc`s don't make sense in bindings.
/// This is not exported to bindings users as `Arc`s don't make sense in bindings.
pub type SimpleArcPeerManager<SD, M, T, F, C, L> = PeerManager<SD, Arc<SimpleArcChannelManager<M, T, F, L>>, Arc<P2PGossipSync<Arc<NetworkGraph<Arc<L>>>, Arc<C>, Arc<L>>>, Arc<SimpleArcOnionMessenger<L>>, Arc<L>, IgnoringMessageHandler, Arc<KeysManager>>;
/// SimpleRefPeerManager is a type alias for a PeerManager reference, and is the reference
@ -532,7 +532,7 @@ pub type SimpleArcPeerManager<SD, M, T, F, C, L> = PeerManager<SD, Arc<SimpleArc
/// But if this is not necessary, using a reference is more efficient. Defining these type aliases
/// helps with issues such as long function definitions.
///
/// (C-not exported) as general type aliases don't make sense in bindings.
/// This is not exported to bindings users as general type aliases don't make sense in bindings.
pub type SimpleRefPeerManager<'a, 'b, 'c, 'd, 'e, 'f, 'g, 'h, 'i, 'j, 'k, 'l, 'm, SD, M, T, F, C, L> = PeerManager<SD, SimpleRefChannelManager<'a, 'b, 'c, 'd, 'e, 'f, 'g, 'm, M, T, F, L>, &'f P2PGossipSync<&'g NetworkGraph<&'f L>, &'h C, &'f L>, &'i SimpleRefOnionMessenger<'j, 'k, L>, &'f L, IgnoringMessageHandler, &'c KeysManager>;
/// A PeerManager manages a set of peers, described by their [`SocketDescriptor`] and marshalls
@ -646,7 +646,7 @@ impl<Descriptor: SocketDescriptor, CM: Deref, OM: Deref, L: Deref, NS: Deref> Pe
/// timestamp, however if it is not available a persistent counter that increases once per
/// minute should suffice.
///
/// (C-not exported) as we can't export a PeerManager with a dummy route handler
/// This is not exported to bindings users as we can't export a PeerManager with a dummy route handler
pub fn new_channel_only(channel_message_handler: CM, onion_message_handler: OM, current_time: u32, ephemeral_random_data: &[u8; 32], logger: L, node_signer: NS) -> Self {
Self::new(MessageHandler {
chan_handler: channel_message_handler,
@ -673,7 +673,7 @@ impl<Descriptor: SocketDescriptor, RM: Deref, L: Deref, NS: Deref> PeerManager<D
/// `ephemeral_random_data` is used to derive per-connection ephemeral keys and must be
/// cryptographically secure random bytes.
///
/// (C-not exported) as we can't export a PeerManager with a dummy channel handler
/// This is not exported to bindings users as we can't export a PeerManager with a dummy channel handler
pub fn new_routing_only(routing_message_handler: RM, current_time: u32, ephemeral_random_data: &[u8; 32], logger: L, node_signer: NS) -> Self {
Self::new(MessageHandler {
chan_handler: ErroringMessageHandler::new(),

View File

@ -463,7 +463,7 @@ impl<ES: Deref, NS: Deref, L: Deref, CMH: Deref> OnionMessageProvider for OnionM
/// Useful for simplifying the parameters of [`SimpleArcChannelManager`] and
/// [`SimpleArcPeerManager`]. See their docs for more details.
///
/// (C-not exported) as `Arc`s don't make sense in bindings.
/// This is not exported to bindings users as `Arc`s don't make sense in bindings.
///
/// [`SimpleArcChannelManager`]: crate::ln::channelmanager::SimpleArcChannelManager
/// [`SimpleArcPeerManager`]: crate::ln::peer_handler::SimpleArcPeerManager
@ -471,7 +471,7 @@ pub type SimpleArcOnionMessenger<L> = OnionMessenger<Arc<KeysManager>, Arc<KeysM
/// Useful for simplifying the parameters of [`SimpleRefChannelManager`] and
/// [`SimpleRefPeerManager`]. See their docs for more details.
///
/// (C-not exported) as general type aliases don't make sense in bindings.
/// This is not exported to bindings users as general type aliases don't make sense in bindings.
///
/// [`SimpleRefChannelManager`]: crate::ln::channelmanager::SimpleRefChannelManager
/// [`SimpleRefPeerManager`]: crate::ln::peer_handler::SimpleRefPeerManager

View File

@ -119,7 +119,7 @@ pub enum OnionMessageContents<T: CustomOnionMessageContents> {
impl<T: CustomOnionMessageContents> OnionMessageContents<T> {
/// Returns the type that was used to decode the message payload.
///
/// (C-not exported) as methods on non-cloneable enums are not currently exportable
/// This is not exported to bindings users as methods on non-cloneable enums are not currently exportable
pub fn tlv_type(&self) -> u64 {
match self {
&OnionMessageContents::Custom(ref msg) => msg.tlv_type(),
@ -127,7 +127,7 @@ impl<T: CustomOnionMessageContents> OnionMessageContents<T> {
}
}
/// (C-not exported) as methods on non-cloneable enums are not currently exportable
/// This is not exported to bindings users as methods on non-cloneable enums are not currently exportable
impl<T: CustomOnionMessageContents> Writeable for OnionMessageContents<T> {
fn write<W: Writer>(&self, w: &mut W) -> Result<(), io::Error> {
match self {

View File

@ -258,7 +258,7 @@ where U::Target: UtxoLookup, L::Target: Logger
/// Gets a reference to the underlying [`NetworkGraph`] which was provided in
/// [`P2PGossipSync::new`].
///
/// (C-not exported) as bindings don't support a reference-to-a-reference yet
/// This is not exported to bindings users as bindings don't support a reference-to-a-reference yet
pub fn network_graph(&self) -> &G {
&self.network_graph
}
@ -1912,7 +1912,7 @@ impl<L: Deref> NetworkGraph<L> where L::Target: Logger {
impl ReadOnlyNetworkGraph<'_> {
/// Returns all known valid channels' short ids along with announced channel info.
///
/// (C-not exported) because we don't want to return lifetime'd references
/// This is not exported to bindings users because we don't want to return lifetime'd references
pub fn channels(&self) -> &IndexedMap<u64, ChannelInfo> {
&*self.channels
}
@ -1930,7 +1930,7 @@ impl ReadOnlyNetworkGraph<'_> {
/// Returns all known nodes' public keys along with announced node info.
///
/// (C-not exported) because we don't want to return lifetime'd references
/// This is not exported to bindings users because we don't want to return lifetime'd references
pub fn nodes(&self) -> &IndexedMap<NodeId, NodeInfo> {
&*self.nodes
}

View File

@ -531,42 +531,42 @@ impl PaymentParameters {
/// Includes the payee's features.
///
/// (C-not exported) since bindings don't support move semantics
/// This is not exported to bindings users since bindings don't support move semantics
pub fn with_features(self, features: InvoiceFeatures) -> Self {
Self { features: Some(features), ..self }
}
/// Includes hints for routing to the payee.
///
/// (C-not exported) since bindings don't support move semantics
/// This is not exported to bindings users since bindings don't support move semantics
pub fn with_route_hints(self, route_hints: Vec<RouteHint>) -> Self {
Self { route_hints, ..self }
}
/// Includes a payment expiration in seconds relative to the UNIX epoch.
///
/// (C-not exported) since bindings don't support move semantics
/// This is not exported to bindings users since bindings don't support move semantics
pub fn with_expiry_time(self, expiry_time: u64) -> Self {
Self { expiry_time: Some(expiry_time), ..self }
}
/// Includes a limit for the total CLTV expiry delta which is considered during routing
///
/// (C-not exported) since bindings don't support move semantics
/// This is not exported to bindings users since bindings don't support move semantics
pub fn with_max_total_cltv_expiry_delta(self, max_total_cltv_expiry_delta: u32) -> Self {
Self { max_total_cltv_expiry_delta, ..self }
}
/// Includes a limit for the maximum number of payment paths that may be used.
///
/// (C-not exported) since bindings don't support move semantics
/// This is not exported to bindings users since bindings don't support move semantics
pub fn with_max_path_count(self, max_path_count: u8) -> Self {
Self { max_path_count, ..self }
}
/// Includes a limit for the maximum number of payment paths that may be used.
///
/// (C-not exported) since bindings don't support move semantics
/// This is not exported to bindings users since bindings don't support move semantics
pub fn with_max_channel_saturation_power_of_half(self, max_channel_saturation_power_of_half: u8) -> Self {
Self { max_channel_saturation_power_of_half, ..self }
}

View File

@ -165,8 +165,7 @@ pub trait WriteableScore<'a>: LockableScore<'a> + Writeable {}
#[cfg(not(c_bindings))]
impl<'a, T> WriteableScore<'a> for T where T: LockableScore<'a> + Writeable {}
/// (C-not exported)
/// This is not exported to bindings users
impl<'a, T: 'a + Score> LockableScore<'a> for Mutex<T> {
type Locked = MutexGuard<'a, T>;
@ -244,7 +243,7 @@ impl<T: Score> MultiThreadedLockableScore<T> {
}
#[cfg(c_bindings)]
/// (C-not exported)
/// This is not exported to bindings users
impl<'a, T: Writeable> Writeable for RefMut<'a, T> {
fn write<W: Writer>(&self, writer: &mut W) -> Result<(), io::Error> {
T::write(&**self, writer)
@ -252,7 +251,7 @@ impl<'a, T: Writeable> Writeable for RefMut<'a, T> {
}
#[cfg(c_bindings)]
/// (C-not exported)
/// This is not exported to bindings users
impl<'a, S: Writeable> Writeable for MutexGuard<'a, S> {
fn write<W: Writer>(&self, writer: &mut W) -> Result<(), io::Error> {
S::write(&**self, writer)
@ -363,7 +362,7 @@ pub type ProbabilisticScorer<G, L> = ProbabilisticScorerUsingTime::<G, L, Config
/// Probabilistic [`Score`] implementation.
///
/// (C-not exported) generally all users should use the [`ProbabilisticScorer`] type alias.
/// This is not exported to bindings users generally all users should use the [`ProbabilisticScorer`] type alias.
pub struct ProbabilisticScorerUsingTime<G: Deref<Target = NetworkGraph<L>>, L: Deref, T: Time>
where L::Target: Logger {
params: ProbabilisticScoringParameters,
@ -510,7 +509,7 @@ pub struct ProbabilisticScoringParameters {
/// node. Note that a manual penalty of `u64::max_value()` means the node would not ever be
/// considered during path finding.
///
/// (C-not exported)
/// This is not exported to bindings users
pub manual_node_penalties: HashMap<NodeId, u64>,
/// This penalty is applied when `htlc_maximum_msat` is equal to or larger than half of the

View File

@ -21,7 +21,7 @@ use core::ops::{Bound, RangeBounds};
/// actually backed by a [`HashMap`], with some additional tracking to ensure we can iterate over
/// keys in the order defined by [`Ord`].
///
/// (C-not exported) as bindings provide alternate accessors rather than exposing maps directly.
/// This is not exported to bindings users as bindings provide alternate accessors rather than exposing maps directly.
///
/// [`BTreeMap`]: alloc::collections::BTreeMap
#[derive(Clone, Debug, Eq)]
@ -150,7 +150,7 @@ impl<K: Hash + Ord + PartialEq, V: PartialEq> PartialEq for IndexedMap<K, V> {
/// An iterator over a range of values in an [`IndexedMap`]
///
/// (C-not exported) as bindings provide alternate accessors rather than exposing maps directly.
/// This is not exported to bindings users as bindings provide alternate accessors rather than exposing maps directly.
pub struct Range<'a, K: Hash + Ord, V> {
inner_range: Iter<'a, K>,
map: &'a HashMap<K, V>,
@ -166,7 +166,7 @@ impl<'a, K: Hash + Ord, V: 'a> Iterator for Range<'a, K, V> {
/// An [`Entry`] for a key which currently has no value
///
/// (C-not exported) as bindings provide alternate accessors rather than exposing maps directly.
/// This is not exported to bindings users as bindings provide alternate accessors rather than exposing maps directly.
pub struct VacantEntry<'a, K: Hash + Ord, V> {
#[cfg(feature = "hashbrown")]
underlying_entry: hash_map::VacantEntry<'a, K, V, hash_map::DefaultHashBuilder>,
@ -178,7 +178,7 @@ pub struct VacantEntry<'a, K: Hash + Ord, V> {
/// An [`Entry`] for an existing key-value pair
///
/// (C-not exported) as bindings provide alternate accessors rather than exposing maps directly.
/// This is not exported to bindings users as bindings provide alternate accessors rather than exposing maps directly.
pub struct OccupiedEntry<'a, K: Hash + Ord, V> {
#[cfg(feature = "hashbrown")]
underlying_entry: hash_map::OccupiedEntry<'a, K, V, hash_map::DefaultHashBuilder>,
@ -190,7 +190,7 @@ pub struct OccupiedEntry<'a, K: Hash + Ord, V> {
/// A mutable reference to a position in the map. This can be used to reference, add, or update the
/// value at a fixed key.
///
/// (C-not exported) as bindings provide alternate accessors rather than exposing maps directly.
/// This is not exported to bindings users as bindings provide alternate accessors rather than exposing maps directly.
pub enum Entry<'a, K: Hash + Ord, V> {
/// A mutable reference to a position within the map where there is no value.
Vacant(VacantEntry<'a, K, V>),

View File

@ -116,7 +116,8 @@ pub struct Record<'a> {
impl<'a> Record<'a> {
/// Returns a new Record.
/// (C-not exported) as fmt can't be used in C
///
/// This is not exported to bindings users as fmt can't be used in C
#[inline]
pub fn new(level: Level, args: fmt::Arguments<'a>, module_path: &'static str, file: &'static str, line: u32) -> Record<'a> {
Record {
@ -141,7 +142,8 @@ pub trait Logger {
}
/// Wrapper for logging a [`PublicKey`] in hex format.
/// (C-not exported) as fmt can't be used in C
///
/// This is not exported to bindings users as fmt can't be used in C
#[doc(hidden)]
pub struct DebugPubKey<'a>(pub &'a PublicKey);
impl<'a> core::fmt::Display for DebugPubKey<'a> {
@ -154,7 +156,8 @@ impl<'a> core::fmt::Display for DebugPubKey<'a> {
}
/// Wrapper for logging byte slices in hex format.
/// (C-not exported) as fmt can't be used in C
///
/// This is not exported to bindings users as fmt can't be used in C
#[doc(hidden)]
pub struct DebugBytes<'a>(pub &'a [u8]);
impl<'a> core::fmt::Display for DebugBytes<'a> {

View File

@ -48,7 +48,7 @@ pub const MAX_BUF_SIZE: usize = 64 * 1024;
/// A simplified version of [`std::io::Write`] that exists largely for backwards compatibility.
/// An impl is provided for any type that also impls [`std::io::Write`].
///
/// (C-not exported) as we only export serialization to/from byte arrays instead
/// This is not exported to bindings users as we only export serialization to/from byte arrays instead
pub trait Writer {
/// Writes the given buf out. See std::io::Write::write_all for more
fn write_all(&mut self, buf: &[u8]) -> Result<(), io::Error>;
@ -90,7 +90,7 @@ impl Writer for VecWriter {
/// Writer that only tracks the amount of data written - useful if you need to calculate the length
/// of some data when serialized but don't yet need the full data.
///
/// (C-not exported) as manual TLV building is not currently supported in bindings
/// This is not exported to bindings users as manual TLV building is not currently supported in bindings
pub struct LengthCalculatingWriter(pub usize);
impl Writer for LengthCalculatingWriter {
#[inline]
@ -103,7 +103,7 @@ impl Writer for LengthCalculatingWriter {
/// Essentially [`std::io::Take`] but a bit simpler and with a method to walk the underlying stream
/// forward to ensure we always consume exactly the fixed length specified.
///
/// (C-not exported) as manual TLV building is not currently supported in bindings
/// This is not exported to bindings users as manual TLV building is not currently supported in bindings
pub struct FixedLengthReader<R: Read> {
read: R,
bytes_read: u64,
@ -160,7 +160,7 @@ impl<R: Read> LengthRead for FixedLengthReader<R> {
/// A [`Read`] implementation which tracks whether any bytes have been read at all. This allows us to distinguish
/// between "EOF reached before we started" and "EOF reached mid-read".
///
/// (C-not exported) as manual TLV building is not currently supported in bindings
/// This is not exported to bindings users as manual TLV building is not currently supported in bindings
pub struct ReadTrackingReader<R: Read> {
read: R,
/// Returns whether we have read from this reader or not yet.
@ -188,7 +188,7 @@ impl<R: Read> Read for ReadTrackingReader<R> {
/// A trait that various LDK types implement allowing them to be written out to a [`Writer`].
///
/// (C-not exported) as we only export serialization to/from byte arrays instead
/// This is not exported to bindings users as we only export serialization to/from byte arrays instead
pub trait Writeable {
/// Writes `self` out to the given [`Writer`].
fn write<W: Writer>(&self, writer: &mut W) -> Result<(), io::Error>;
@ -228,7 +228,7 @@ impl<'a, T: Writeable> Writeable for &'a T {
/// A trait that various LDK types implement allowing them to be read in from a [`Read`].
///
/// (C-not exported) as we only export serialization to/from byte arrays instead
/// This is not exported to bindings users as we only export serialization to/from byte arrays instead
pub trait Readable
where Self: Sized
{
@ -246,7 +246,7 @@ pub(crate) trait SeekReadable where Self: Sized {
/// A trait that various higher-level LDK types implement allowing them to be read in
/// from a [`Read`] given some additional set of arguments which is required to deserialize.
///
/// (C-not exported) as we only export serialization to/from byte arrays instead
/// This is not exported to bindings users as we only export serialization to/from byte arrays instead
pub trait ReadableArgs<P>
where Self: Sized
{
@ -279,7 +279,7 @@ pub(crate) trait LengthReadable where Self: Sized
/// A trait that various LDK types implement allowing them to (maybe) be read in from a [`Read`].
///
/// (C-not exported) as we only export serialization to/from byte arrays instead
/// This is not exported to bindings users as we only export serialization to/from byte arrays instead
pub trait MaybeReadable
where Self: Sized
{
@ -296,7 +296,7 @@ impl<T: Readable> MaybeReadable for T {
/// Wrapper to read a required (non-optional) TLV record.
///
/// (C-not exported) as manual TLV building is not currently supported in bindings
/// This is not exported to bindings users as manual TLV building is not currently supported in bindings
pub struct RequiredWrapper<T>(pub Option<T>);
impl<T: Readable> Readable for RequiredWrapper<T> {
#[inline]
@ -320,7 +320,7 @@ impl<T> From<T> for RequiredWrapper<T> {
/// Wrapper to read a required (non-optional) TLV record that may have been upgraded without
/// backwards compat.
///
/// (C-not exported) as manual TLV building is not currently supported in bindings
/// This is not exported to bindings users as manual TLV building is not currently supported in bindings
pub struct UpgradableRequired<T: MaybeReadable>(pub Option<T>);
impl<T: MaybeReadable> MaybeReadable for UpgradableRequired<T> {
#[inline]
@ -602,7 +602,7 @@ impl Readable for [u16; 8] {
/// A type for variable-length values within TLV record where the length is encoded as part of the record.
/// Used to prevent encoding the length twice.
///
/// (C-not exported) as manual TLV building is not currently supported in bindings
/// This is not exported to bindings users as manual TLV building is not currently supported in bindings
pub struct WithoutLength<T>(pub T);
impl Writeable for WithoutLength<&String> {

View File

@ -183,7 +183,7 @@ impl Future {
/// Registers a callback to be called upon completion of this future. If the future has already
/// completed, the callback will be called immediately.
///
/// (C-not exported) use the bindings-only `register_callback_fn` instead
/// This is not exported to bindings users, use the bindings-only `register_callback_fn` instead
pub fn register_callback(&self, callback: Box<dyn FutureCallback>) {
let mut state = self.state.lock().unwrap();
if state.complete {
@ -212,7 +212,7 @@ impl FutureCallback for StdWaker {
fn call(&self) { self.0.wake_by_ref() }
}
/// (C-not exported) as Rust Futures aren't usable in language bindings.
/// This is not exported to bindings users as Rust Futures aren't usable in language bindings.
impl<'a> StdFuture for Future {
type Output = ();