From: munjesi Date: Thu, 16 Mar 2023 17:35:52 +0000 (+0300) Subject: Replacing (C-not exported) in the docs X-Git-Tag: v0.0.115~53^2 X-Git-Url: http://git.bitcoin.ninja/?a=commitdiff_plain;h=b0bf50fa2493e5364511eb781db9772a06e140f9;p=rust-lightning Replacing (C-not exported) in the docs --- diff --git a/lightning-background-processor/src/lib.rs b/lightning-background-processor/src/lib.rs index e407c4fdb..1d0d78738 100644 --- a/lightning-background-processor/src/lib.rs +++ b/lightning-background-processor/src/lib.rs @@ -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>, G: Deref>, U: Deref, L: Deref> GossipSync, 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>, G: Deref>, L: Deref> GossipSync< &P2PGossipSync, @@ -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, &'a (dyn UtxoLookup + Send + Sync), L>, diff --git a/lightning-invoice/src/lib.rs b/lightning-invoice/src/lib.rs index 37c74922e..3222e75e2 100644 --- a/lightning-invoice/src/lib.rs +++ b/lightning-invoice/src/lib.rs @@ -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 { 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` +/// This is not exported to bindings users as we don't yet support `Option` #[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 @@ -873,7 +873,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(self, sign_method: F) -> Result where F: FnOnce(&Message) -> Result @@ -892,7 +892,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, fn(&RawTaggedField) -> Option<&TaggedField>> { @@ -941,7 +941,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() } @@ -1170,7 +1170,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, fn(&RawTaggedField) -> Option<&TaggedField>> { self.signed_invoice.raw_invoice().known_tagged_fields() @@ -1183,7 +1183,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); @@ -1253,7 +1253,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() } diff --git a/lightning-invoice/src/ser.rs b/lightning-invoice/src/ser.rs index a6ccf873f..c9fca01f1 100644 --- a/lightning-invoice/src/ser.rs +++ b/lightning-invoice/src/ser.rs @@ -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 { diff --git a/lightning-rapid-gossip-sync/src/lib.rs b/lightning-rapid-gossip-sync/src/lib.rs index 00aac9fd3..da59b37b1 100644 --- a/lightning-rapid-gossip-sync/src/lib.rs +++ b/lightning-rapid-gossip-sync/src/lib.rs @@ -146,7 +146,7 @@ impl>, L: Deref> RapidGossipSync 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 } diff --git a/lightning/src/chain/keysinterface.rs b/lightning/src/chain/keysinterface.rs index 21331fff4..c523ce5d5 100644 --- a/lightning/src/chain/keysinterface.rs +++ b/lightning/src/chain/keysinterface.rs @@ -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]); diff --git a/lightning/src/chain/transaction.rs b/lightning/src/chain/transaction.rs index 4fc0839f9..ce449a410 100644 --- a/lightning/src/chain/transaction.rs +++ b/lightning/src/chain/transaction.rs @@ -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, diff --git a/lightning/src/ln/chan_utils.rs b/lightning/src/ln/chan_utils.rs index 3893051ca..d5deb634e 100644 --- a/lightning/src/ln/chan_utils.rs +++ b/lightning/src/ln/chan_utils.rs @@ -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(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 { &self.htlcs diff --git a/lightning/src/ln/channelmanager.rs b/lightning/src/ln/channelmanager.rs index 90afc0169..3a399844a 100644 --- a/lightning/src/ln/channelmanager.rs +++ b/lightning/src/ln/channelmanager.rs @@ -198,7 +198,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]); @@ -216,7 +217,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]); @@ -568,7 +570,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 = ChannelManager< Arc, Arc, @@ -594,7 +596,7 @@ pub type SimpleArcChannelManager = 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, &'g L>>>, &'g L>; /// Manager which keeps track of a number of channels and sends messages to the appropriate @@ -7235,7 +7237,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::Signer>>, } diff --git a/lightning/src/ln/features.rs b/lightning/src/ln/features.rs index fe879a568..b4a5c5ae5 100644 --- a/lightning/src/ln/features.rs +++ b/lightning/src/ln/features.rs @@ -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 { /// Note that, for convenience, flags is LITTLE endian (despite being big-endian on the wire) @@ -622,7 +622,8 @@ impl Features { /// 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) -> Features { Features { flags, diff --git a/lightning/src/ln/mod.rs b/lightning/src/ln/mod.rs index f328f6b9c..340213c51 100644 --- a/lightning/src/ln/mod.rs +++ b/lightning/src/ln/mod.rs @@ -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]); diff --git a/lightning/src/ln/msgs.rs b/lightning/src/ln/msgs.rs index 6e49a46f0..7aeb5c87a 100644 --- a/lightning/src/ln/msgs.rs +++ b/lightning/src/ln/msgs.rs @@ -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 { /// Optional field is included in message diff --git a/lightning/src/ln/peer_handler.rs b/lightning/src/ln/peer_handler.rs index 913ece646..5c841d78a 100644 --- a/lightning/src/ln/peer_handler.rs +++ b/lightning/src/ln/peer_handler.rs @@ -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 = PeerManager>, Arc>>, Arc, Arc>>, Arc>, Arc, IgnoringMessageHandler, Arc>; /// SimpleRefPeerManager is a type alias for a PeerManager reference, and is the reference @@ -532,7 +532,7 @@ pub type SimpleArcPeerManager = PeerManager = PeerManager, &'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 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 PeerManager Self { Self::new(MessageHandler { chan_handler: ErroringMessageHandler::new(), diff --git a/lightning/src/onion_message/messenger.rs b/lightning/src/onion_message/messenger.rs index 7814ccb65..7eb0439d2 100644 --- a/lightning/src/onion_message/messenger.rs +++ b/lightning/src/onion_message/messenger.rs @@ -463,7 +463,7 @@ impl 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 = OnionMessenger, Arc { impl OnionMessageContents { /// 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 OnionMessageContents { } } -/// (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 Writeable for OnionMessageContents { fn write(&self, w: &mut W) -> Result<(), io::Error> { match self { diff --git a/lightning/src/routing/gossip.rs b/lightning/src/routing/gossip.rs index 513ff1a22..0ee9d4cf8 100644 --- a/lightning/src/routing/gossip.rs +++ b/lightning/src/routing/gossip.rs @@ -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 NetworkGraph 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 { &*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 { &*self.nodes } diff --git a/lightning/src/routing/router.rs b/lightning/src/routing/router.rs index baa2ecce1..a9e107359 100644 --- a/lightning/src/routing/router.rs +++ b/lightning/src/routing/router.rs @@ -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) -> 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 } } diff --git a/lightning/src/routing/scoring.rs b/lightning/src/routing/scoring.rs index adfc59c92..4d342562b 100644 --- a/lightning/src/routing/scoring.rs +++ b/lightning/src/routing/scoring.rs @@ -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 { type Locked = MutexGuard<'a, T>; @@ -244,7 +243,7 @@ impl MultiThreadedLockableScore { } #[cfg(c_bindings)] -/// (C-not exported) +/// This is not exported to bindings users impl<'a, T: Writeable> Writeable for RefMut<'a, T> { fn write(&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(&self, writer: &mut W) -> Result<(), io::Error> { S::write(&**self, writer) @@ -363,7 +362,7 @@ pub type ProbabilisticScorer = ProbabilisticScorerUsingTime::>, 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, /// This penalty is applied when `htlc_maximum_msat` is equal to or larger than half of the diff --git a/lightning/src/util/indexed_map.rs b/lightning/src/util/indexed_map.rs index 2b5bbac0d..bb17d3450 100644 --- a/lightning/src/util/indexed_map.rs +++ b/lightning/src/util/indexed_map.rs @@ -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 PartialEq for IndexedMap { /// 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, @@ -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>), diff --git a/lightning/src/util/logger.rs b/lightning/src/util/logger.rs index 154e26cdf..aac83f42a 100644 --- a/lightning/src/util/logger.rs +++ b/lightning/src/util/logger.rs @@ -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> { diff --git a/lightning/src/util/ser.rs b/lightning/src/util/ser.rs index f0208aad4..349105266 100644 --- a/lightning/src/util/ser.rs +++ b/lightning/src/util/ser.rs @@ -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 { read: R, bytes_read: u64, @@ -160,7 +160,7 @@ impl LengthRead for FixedLengthReader { /// 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 { read: R, /// Returns whether we have read from this reader or not yet. @@ -188,7 +188,7 @@ impl Read for ReadTrackingReader { /// 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(&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

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 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(pub Option); impl Readable for RequiredWrapper { #[inline] @@ -320,7 +320,7 @@ impl From for RequiredWrapper { /// 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(pub Option); impl MaybeReadable for UpgradableRequired { #[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(pub T); impl Writeable for WithoutLength<&String> { diff --git a/lightning/src/util/wakers.rs b/lightning/src/util/wakers.rs index f86fc376c..1e41b2dae 100644 --- a/lightning/src/util/wakers.rs +++ b/lightning/src/util/wakers.rs @@ -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) { 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 = ();