Skip to content

Commit 702d5bc

Browse files
committed
Replacing (C-not exported) in the docs
Replaced with (This is not exported to bindings users) and also added new line in docs with /// and a new line separating it in the code.
1 parent d8e2aa5 commit 702d5bc

File tree

21 files changed

+163
-84
lines changed

21 files changed

+163
-84
lines changed

lightning-background-processor/src/lib.rs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -163,8 +163,9 @@ where U::Target: UtxoLookup, L::Target: Logger {
163163
}
164164
}
165165
}
166+
///
166167
167-
// (C-not exported) as the bindings concretize everything and have constructors for us
168+
/// (This is not exported to bindings users) as the bindings concretize everything and have constructors for us
168169
impl<P: Deref<Target = P2PGossipSync<G, U, L>>, G: Deref<Target = NetworkGraph<L>>, U: Deref, L: Deref>
169170
GossipSync<P, &RapidGossipSync<G, L>, G, U, L>
170171
where
@@ -176,8 +177,9 @@ where
176177
GossipSync::P2P(gossip_sync)
177178
}
178179
}
180+
///
179181
180-
// (C-not exported) as the bindings concretize everything and have constructors for us
182+
/// (This is not exported to bindings users) as the bindings concretize everything and have constructors for us
181183
impl<'a, R: Deref<Target = RapidGossipSync<G, L>>, G: Deref<Target = NetworkGraph<L>>, L: Deref>
182184
GossipSync<
183185
&P2PGossipSync<G, &'a (dyn UtxoLookup + Send + Sync), L>,
@@ -194,8 +196,9 @@ where
194196
GossipSync::Rapid(gossip_sync)
195197
}
196198
}
199+
///
197200
198-
// (C-not exported) as the bindings concretize everything and have constructors for us
201+
/// (This is not exported to bindings users) as the bindings concretize everything and have constructors for us
199202
impl<'a, L: Deref>
200203
GossipSync<
201204
&P2PGossipSync<&'a NetworkGraph<L>, &'a (dyn UtxoLookup + Send + Sync), L>,

lightning-invoice/src/lib.rs

Lines changed: 22 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -215,8 +215,9 @@ pub const DEFAULT_MIN_FINAL_CLTV_EXPIRY_DELTA: u64 = 18;
215215
/// * `D`: exactly one `Description` or `DescriptionHash`
216216
/// * `H`: exactly one `PaymentHash`
217217
/// * `T`: the timestamp is set
218+
///
218219
219-
// (C-not exported) as we likely need to manually select one set of boolean type parameters.
220+
/// (This is not exported to bindings users) as we likely need to manually select one set of boolean type parameters.
220221
#[derive(Eq, PartialEq, Debug, Clone)]
221222
pub struct InvoiceBuilder<D: tb::Bool, H: tb::Bool, T: tb::Bool, C: tb::Bool, S: tb::Bool> {
222223
currency: Currency,
@@ -246,9 +247,10 @@ pub struct Invoice {
246247

247248
/// Represents the description of an invoice which has to be either a directly included string or
248249
/// a hash of a description provided out of band.
250+
///
249251
250-
// (C-not exported) As we don't have a good way to map the reference lifetimes making this
251-
// practically impossible to use safely in languages like C.
252+
/// (This is not exported to bindings users) As we don't have a good way to map the reference lifetimes making this
253+
/// practically impossible to use safely in languages like C.
252254
#[derive(Eq, PartialEq, Debug, Clone)]
253255
pub enum InvoiceDescription<'f> {
254256
/// Reference to the directly supplied description in the invoice
@@ -296,8 +298,9 @@ pub struct RawInvoice {
296298
}
297299

298300
/// Data of the `RawInvoice` that is encoded in the human readable part
301+
///
299302
300-
// (C-not exported) As we don't yet support `Option<Enum>`
303+
/// (This is not exported to bindings users) As we don't yet support `Option<Enum>`
301304
#[derive(Eq, PartialEq, Debug, Clone, Hash)]
302305
pub struct RawHrp {
303306
/// The currency deferred from the 3rd and 4th character of the bech32 transaction
@@ -357,8 +360,8 @@ impl SiPrefix {
357360
/// Returns all enum variants of `SiPrefix` sorted in descending order of their associated
358361
/// multiplier.
359362
360-
// (C-not exported) As we don't yet support a slice of enums, and also because this function
361-
// isn't the most critical to expose.
363+
/// (This is not exported to bindings users) As we don't yet support a slice of enums, and also because this function
364+
/// isn't the most critical to expose.
362365
pub fn values_desc() -> &'static [SiPrefix] {
363366
use crate::SiPrefix::*;
364367
static VALUES: [SiPrefix; 4] = [Milli, Micro, Nano, Pico];
@@ -386,8 +389,9 @@ pub enum Currency {
386389
}
387390

388391
/// Tagged field which may have an unknown tag
392+
///
389393
390-
// (C-not exported) as we don't currently support TaggedField
394+
/// (This is not exported to bindings users) as we don't currently support TaggedField
391395
#[derive(Clone, Debug, Hash, Eq, PartialEq)]
392396
pub enum RawTaggedField {
393397
/// Parsed tagged field with known tag
@@ -399,9 +403,10 @@ pub enum RawTaggedField {
399403
/// Tagged field with known tag
400404
///
401405
/// For descriptions of the enum values please refer to the enclosed type's docs.
406+
///
402407
403-
// (C-not exported) As we don't yet support enum variants with the same name the struct contained
404-
// in the variant.
408+
/// (This is not exported to bindings users) As we don't yet support enum variants with the same name the struct contained
409+
/// in the variant.
405410
#[allow(missing_docs)]
406411
#[derive(Clone, Debug, Hash, Eq, PartialEq)]
407412
pub enum TaggedField {
@@ -419,7 +424,7 @@ pub enum TaggedField {
419424

420425
/// SHA-256 hash
421426
#[derive(Clone, Debug, Hash, Eq, PartialEq)]
422-
pub struct Sha256(// (C-not exported) as the native hash types are not currently mapped
427+
pub struct Sha256(/// (This is not exported to bindings users) as the native hash types are not currently mapped
423428
pub sha256::Hash);
424429

425430
/// Description string
@@ -873,8 +878,8 @@ impl RawInvoice {
873878
/// of type `E`. Since the signature of a `SignedRawInvoice` is not required to be valid there
874879
/// are no constraints regarding the validity of the produced signature.
875880
876-
// (C-not exported) As we don't currently support passing function pointers into methods
877-
// explicitly.
881+
/// (This is not exported to bindings users) As we don't currently support passing function pointers into methods
882+
/// explicitly.
878883
pub fn sign<F, E>(self, sign_method: F) -> Result<SignedRawInvoice, E>
879884
where F: FnOnce(&Message) -> Result<RecoverableSignature, E>
880885
{
@@ -892,7 +897,7 @@ impl RawInvoice {
892897

893898
/// Returns an iterator over all tagged fields with known semantics.
894899
895-
// (C-not exported) As there is not yet a manual mapping for a FilterMap
900+
/// (This is not exported to bindings users) As there is not yet a manual mapping for a FilterMap
896901
pub fn known_tagged_fields(&self)
897902
-> FilterMap<Iter<RawTaggedField>, fn(&RawTaggedField) -> Option<&TaggedField>>
898903
{
@@ -941,7 +946,7 @@ impl RawInvoice {
941946
find_extract!(self.known_tagged_fields(), TaggedField::Features(ref x), x)
942947
}
943948

944-
// (C-not exported) as we don't support Vec<&NonOpaqueType>
949+
/// (This is not exported to bindings users) as we don't support Vec<&NonOpaqueType>
945950
pub fn fallbacks(&self) -> Vec<&Fallback> {
946951
find_all_extract!(self.known_tagged_fields(), TaggedField::Fallback(ref x), x).collect()
947952
}
@@ -1170,7 +1175,7 @@ impl Invoice {
11701175

11711176
/// Returns an iterator over all tagged fields of this Invoice.
11721177
1173-
// (C-not exported) As there is not yet a manual mapping for a FilterMap
1178+
/// (This is not exported to bindings users) As there is not yet a manual mapping for a FilterMap
11741179
pub fn tagged_fields(&self)
11751180
-> FilterMap<Iter<RawTaggedField>, fn(&RawTaggedField) -> Option<&TaggedField>> {
11761181
self.signed_invoice.raw_invoice().known_tagged_fields()
@@ -1183,7 +1188,7 @@ impl Invoice {
11831188

11841189
/// Return the description or a hash of it for longer ones
11851190
1186-
// (C-not exported) because we don't yet export InvoiceDescription
1191+
/// (This is not exported to bindings users) because we don't yet export InvoiceDescription
11871192
pub fn description(&self) -> InvoiceDescription {
11881193
if let Some(direct) = self.signed_invoice.description() {
11891194
return InvoiceDescription::Direct(direct);
@@ -1253,7 +1258,7 @@ impl Invoice {
12531258

12541259
/// Returns a list of all fallback addresses
12551260
1256-
// (C-not exported) as we don't support Vec<&NonOpaqueType>
1261+
/// (This is not exported to bindings users) as we don't support Vec<&NonOpaqueType>
12571262
pub fn fallbacks(&self) -> Vec<&Fallback> {
12581263
self.signed_invoice.fallbacks()
12591264
}

lightning-invoice/src/ser.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,8 +123,9 @@ impl Display for SignedRawInvoice {
123123
Ok(())
124124
}
125125
}
126+
///
126127
127-
// (C-not exported)
128+
/// (This is not exported to bindings users)
128129
impl Display for RawHrp {
129130
fn fmt(&self, f: &mut Formatter) -> Result<(), fmt::Error> {
130131
let amount = match self.raw_amount {

lightning-rapid-gossip-sync/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ impl<NG: Deref<Target=NetworkGraph<L>>, L: Deref> RapidGossipSync<NG, L> where L
146146
/// Gets a reference to the underlying [`NetworkGraph`] which was provided in
147147
/// [`RapidGossipSync::new`].
148148
149-
// (C-not exported) as bindings don't support a reference-to-a-reference yet
149+
/// (This is not exported to bindings users) as bindings don't support a reference-to-a-reference yet
150150
pub fn network_graph(&self) -> &NG {
151151
&self.network_graph
152152
}

lightning/src/chain/keysinterface.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,9 @@ use crate::util::invoice::construct_invoice_preimage;
5454

5555
/// Used as initial key material, to be expanded into multiple secret keys (but not to be used
5656
/// directly). This is used within LDK to encrypt/decrypt inbound payment data.
57+
///
5758
58-
// (C-not exported) as we just use `[u8; 32]` directly
59+
/// (This is not exported to bindings users) as we just use `[u8; 32]` directly
5960
#[derive(Hash, Copy, Clone, PartialEq, Eq, Debug)]
6061
pub struct KeyMaterial(pub [u8; 32]);
6162

lightning/src/chain/transaction.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,8 @@ impl OutPoint {
6767

6868
/// Converts this OutPoint into the OutPoint field as used by rust-bitcoin
6969
70-
// (C-not exported) as the same type is used universally in the C bindings for all outpoints
70+
/// (This is not exported to bindings users) as the same type is used universally in the C bindings
71+
/// for all outpoints
7172
pub fn into_bitcoin_outpoint(self) -> BitcoinOutPoint {
7273
BitcoinOutPoint {
7374
txid: self.txid,

lightning/src/ln/chan_utils.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1272,7 +1272,7 @@ impl CommitmentTransaction {
12721272
///
12731273
/// Only include HTLCs that are above the dust limit for the channel.
12741274
1275-
// (C-not exported) due to the generic though we likely should expose a version without
1275+
/// (This is not exported to bindings users) due to the generic though we likely should expose a version without
12761276
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 {
12771277
// Sort outputs and populate output indices while keeping track of the auxiliary data
12781278
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 {
12981298

12991299
/// Use non-zero fee anchors
13001300
1301-
// (C-not exported) due to move, and also not likely to be useful for binding users
1301+
/// (This is not exported to bindings users) due to move, and also not likely to be useful for binding users
13021302
pub fn with_non_zero_fee_anchors(mut self) -> Self {
13031303
self.opt_non_zero_fee_anchors = Some(());
13041304
self
@@ -1479,8 +1479,8 @@ impl CommitmentTransaction {
14791479
/// which were included in this commitment transaction in output order.
14801480
/// The transaction index is always populated.
14811481
1482-
// (C-not exported) as we cannot currently convert Vec references to/from C, though we should
1483-
// expose a less effecient version which creates a Vec of references in the future.
1482+
/// (This is not exported to bindings users) as we cannot currently convert Vec references to/from C, though we should
1483+
/// expose a less effecient version which creates a Vec of references in the future.
14841484
pub fn htlcs(&self) -> &Vec<HTLCOutputInCommitment> {
14851485
&self.htlcs
14861486
}

lightning/src/ln/channelmanager.rs

Lines changed: 37 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -198,8 +198,20 @@ struct ClaimableHTLC {
198198
}
199199

200200
/// A payment identifier used to uniquely identify a payment to LDK.
201+
///
202+
///
203+
///
204+
///
205+
///
206+
///
207+
///
208+
///
209+
///
210+
///
211+
///
212+
///
201213
202-
// (C-not exported) as we just use [u8; 32] directly
214+
/// (This is not exported to bindings users) as we just use [u8; 32] directly
203215
#[derive(Hash, Copy, Clone, PartialEq, Eq, Debug)]
204216
pub struct PaymentId(pub [u8; 32]);
205217

@@ -217,8 +229,26 @@ impl Readable for PaymentId {
217229
}
218230

219231
/// An identifier used to uniquely identify an intercepted HTLC to LDK.
232+
///
233+
///
234+
///
235+
///
236+
///
237+
///
238+
///
239+
///
240+
///
241+
///
242+
///
243+
///
244+
///
245+
///
246+
///
247+
///
248+
///
249+
///
220250
221-
// (C-not exported) as we just use [u8; 32] directly
251+
/// (This is not exported to bindings users) as we just use [u8; 32] directly
222252
#[derive(Hash, Copy, Clone, PartialEq, Eq, Debug)]
223253
pub struct InterceptId(pub [u8; 32]);
224254

@@ -568,8 +598,9 @@ struct PendingInboundPayment {
568598
/// issues such as overly long function definitions. Note that the ChannelManager can take any type
569599
/// that implements KeysInterface or Router for its keys manager and router, respectively, but this
570600
/// type alias chooses the concrete types of KeysManager and DefaultRouter.
601+
///
571602
572-
// (C-not exported) as Arcs don't make sense in bindings
603+
/// (This is not exported to bindings users) as Arcs don't make sense in bindings
573604
pub type SimpleArcChannelManager<M, T, F, L> = ChannelManager<
574605
Arc<M>,
575606
Arc<T>,
@@ -593,8 +624,9 @@ pub type SimpleArcChannelManager<M, T, F, L> = ChannelManager<
593624
/// issues such as overly long function definitions. Note that the ChannelManager can take any type
594625
/// that implements KeysInterface or Router for its keys manager and router, respectively, but this
595626
/// type alias chooses the concrete types of KeysManager and DefaultRouter.
627+
///
596628
597-
// (C-not exported) as Arcs don't make sense in bindings
629+
/// (This is not exported to bindings users) as Arcs don't make sense in bindings
598630
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>;
599631

600632
/// Manager which keeps track of a number of channels and sends messages to the appropriate
@@ -7211,7 +7243,7 @@ where
72117243
/// In such cases the latest local transactions will be sent to the tx_broadcaster included in
72127244
/// this struct.
72137245
7214-
// (C-not exported) because we have no HashMap bindings
7246+
/// (This is not exported to bindings users) because we have no HashMap bindings
72157247
pub channel_monitors: HashMap<OutPoint, &'a mut ChannelMonitor<<SP::Target as SignerProvider>::Signer>>,
72167248
}
72177249

lightning/src/ln/features.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -392,8 +392,9 @@ mod sealed {
392392

393393
/// Tracks the set of features which a node implements, templated by the context in which it
394394
/// appears.
395+
///
395396
396-
// (C-not exported) as we map the concrete feature types below directly instead
397+
/// (This is not exported to bindings users) as we map the concrete feature types below directly instead
397398
#[derive(Eq)]
398399
pub struct Features<T: sealed::Context> {
399400
/// Note that, for convenience, flags is LITTLE endian (despite being big-endian on the wire)
@@ -623,7 +624,7 @@ impl<T: sealed::Context> Features<T> {
623624
/// Create a Features given a set of flags, in little-endian. This is in reverse byte order from
624625
/// most on-the-wire encodings.
625626
626-
// (C-not exported) as we don't support export across multiple T
627+
/// (This is not exported to bindings users) as we don't support export across multiple T
627628
pub fn from_le_bytes(flags: Vec<u8>) -> Features<T> {
628629
Features {
629630
flags,

lightning/src/ln/mod.rs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,18 +82,21 @@ mod shutdown_tests;
8282
pub use self::peer_channel_encryptor::LN_MAX_MSG_LEN;
8383

8484
/// payment_hash type, use to cross-lock hop
85+
///
8586
86-
// (C-not exported) as we just use [u8; 32] directly
87+
/// (This is not exported to bindings users) as we just use [u8; 32] directly
8788
#[derive(Hash, Copy, Clone, PartialEq, Eq, Debug)]
8889
pub struct PaymentHash(pub [u8; 32]);
8990
/// payment_preimage type, use to route payment between hop
91+
///
9092
91-
// (C-not exported) as we just use [u8; 32] directly
93+
/// (This is not exported to bindings users) as we just use [u8; 32] directly
9294
#[derive(Hash, Copy, Clone, PartialEq, Eq, Debug)]
9395
pub struct PaymentPreimage(pub [u8; 32]);
9496
/// payment_secret type, use to authenticate sender to the receiver and tie MPP HTLCs together
97+
///
9598
96-
// (C-not exported) as we just use [u8; 32] directly
99+
/// (This is not exported to bindings users) as we just use [u8; 32] directly
97100
#[derive(Hash, Copy, Clone, PartialEq, Eq, Debug)]
98101
pub struct PaymentSecret(pub [u8; 32]);
99102

lightning/src/ln/msgs.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -938,8 +938,9 @@ pub struct CommitmentUpdate {
938938
/// As we wish to serialize these differently from `Option<T>`s (`Options` get a tag byte, but
939939
/// [`OptionalField`] simply gets `Present` if there are enough bytes to read into it), we have a
940940
/// separate enum type for them.
941+
///
941942
942-
// (C-not exported) due to a free generic in `T`
943+
/// (This is not exported to bindings users) due to a free generic in `T`
943944
#[derive(Clone, Debug, PartialEq, Eq)]
944945
pub enum OptionalField<T> {
945946
/// Optional field is included in message

0 commit comments

Comments
 (0)