Skip to content

Commit 3ad0a1c

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 12d799e commit 3ad0a1c

File tree

21 files changed

+193
-104
lines changed

21 files changed

+193
-104
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: 24 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,8 @@ pub const DEFAULT_MIN_FINAL_CLTV_EXPIRY_DELTA: u64 = 18;
216216
/// * `H`: exactly one `PaymentHash`
217217
/// * `T`: the timestamp is set
218218
///
219-
/// (C-not exported) as we likely need to manually select one set of boolean type parameters.
219+
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,
@@ -247,7 +248,8 @@ pub struct Invoice {
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.
249250
///
250-
/// (C-not exported) As we don't have a good way to map the reference lifetimes making this
251+
252+
/// (This is not exported to bindings users) As we don't have a good way to map the reference lifetimes making this
251253
/// practically impossible to use safely in languages like C.
252254
#[derive(Eq, PartialEq, Debug, Clone)]
253255
pub enum InvoiceDescription<'f> {
@@ -297,7 +299,8 @@ pub struct RawInvoice {
297299

298300
/// Data of the `RawInvoice` that is encoded in the human readable part
299301
///
300-
/// (C-not exported) As we don't yet support `Option<Enum>`
302+
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
@@ -356,8 +359,8 @@ impl SiPrefix {
356359

357360
/// Returns all enum variants of `SiPrefix` sorted in descending order of their associated
358361
/// multiplier.
359-
///
360-
/// (C-not exported) As we don't yet support a slice of enums, and also because this function
362+
363+
/// (This is not exported to bindings users) As we don't yet support a slice of enums, and also because this function
361364
/// isn't the most critical to expose.
362365
pub fn values_desc() -> &'static [SiPrefix] {
363366
use crate::SiPrefix::*;
@@ -387,7 +390,8 @@ pub enum Currency {
387390

388391
/// Tagged field which may have an unknown tag
389392
///
390-
/// (C-not exported) as we don't currently support TaggedField
393+
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
@@ -400,7 +404,8 @@ pub enum RawTaggedField {
400404
///
401405
/// For descriptions of the enum values please refer to the enclosed type's docs.
402406
///
403-
/// (C-not exported) As we don't yet support enum variants with the same name the struct contained
407+
408+
/// (This is not exported to bindings users) As we don't yet support enum variants with the same name the struct contained
404409
/// in the variant.
405410
#[allow(missing_docs)]
406411
#[derive(Clone, Debug, Hash, Eq, PartialEq)]
@@ -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
@@ -872,8 +877,8 @@ impl RawInvoice {
872877
/// Signs the invoice using the supplied `sign_function`. This function MAY fail with an error
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.
875-
///
876-
/// (C-not exported) As we don't currently support passing function pointers into methods
880+
881+
/// (This is not exported to bindings users) As we don't currently support passing function pointers into methods
877882
/// explicitly.
878883
pub fn sign<F, E>(self, sign_method: F) -> Result<SignedRawInvoice, E>
879884
where F: FnOnce(&Message) -> Result<RecoverableSignature, E>
@@ -891,8 +896,8 @@ impl RawInvoice {
891896
}
892897

893898
/// Returns an iterator over all tagged fields with known semantics.
894-
///
895-
/// (C-not exported) As there is not yet a manual mapping for a FilterMap
899+
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
}
@@ -1169,8 +1174,8 @@ impl Invoice {
11691174
}
11701175

11711176
/// Returns an iterator over all tagged fields of this Invoice.
1172-
///
1173-
/// (C-not exported) As there is not yet a manual mapping for a FilterMap
1177+
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()
@@ -1182,8 +1187,8 @@ impl Invoice {
11821187
}
11831188

11841189
/// Return the description or a hash of it for longer ones
1185-
///
1186-
/// (C-not exported) because we don't yet export InvoiceDescription
1190+
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);
@@ -1252,8 +1257,8 @@ impl Invoice {
12521257
}
12531258

12541259
/// Returns a list of all fallback addresses
1255-
///
1256-
/// (C-not exported) as we don't support Vec<&NonOpaqueType>
1260+
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: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -145,8 +145,8 @@ impl<NG: Deref<Target=NetworkGraph<L>>, L: Deref> RapidGossipSync<NG, L> where L
145145

146146
/// Gets a reference to the underlying [`NetworkGraph`] which was provided in
147147
/// [`RapidGossipSync::new`].
148-
///
149-
/// (C-not exported) as bindings don't support a reference-to-a-reference yet
148+
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
@@ -55,7 +55,8 @@ use crate::util::invoice::construct_invoice_preimage;
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.
5757
///
58-
/// (C-not exported) as we just use `[u8; 32]` directly
58+
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: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,9 @@ impl OutPoint {
6666
}
6767

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

lightning/src/ln/chan_utils.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1271,8 +1271,8 @@ impl CommitmentTransaction {
12711271
/// This auxiliary data is not stored in this object.
12721272
///
12731273
/// Only include HTLCs that are above the dust limit for the channel.
1274-
///
1275-
/// (C-not exported) due to the generic though we likely should expose a version without
1274+
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();
@@ -1297,8 +1297,8 @@ impl CommitmentTransaction {
12971297
}
12981298

12991299
/// Use non-zero fee anchors
1300-
///
1301-
/// (C-not exported) due to move, and also not likely to be useful for binding users
1300+
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
@@ -1478,8 +1478,8 @@ impl CommitmentTransaction {
14781478
/// The non-dust HTLCs (direction, amt, height expiration, hash, transaction output index)
14791479
/// which were included in this commitment transaction in output order.
14801480
/// The transaction index is always populated.
1481-
///
1482-
/// (C-not exported) as we cannot currently convert Vec references to/from C, though we should
1481+
1482+
/// (This is not exported to bindings users) as we cannot currently convert Vec references to/from C, though we should
14831483
/// expose a less effecient version which creates a Vec of references in the future.
14841484
pub fn htlcs(&self) -> &Vec<HTLCOutputInCommitment> {
14851485
&self.htlcs

lightning/src/ln/channelmanager.rs

Lines changed: 40 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,20 @@ struct ClaimableHTLC {
198198
}
199199

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

@@ -216,7 +229,26 @@ impl Readable for PaymentId {
216229
}
217230

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

@@ -567,7 +599,8 @@ struct PendingInboundPayment {
567599
/// that implements KeysInterface or Router for its keys manager and router, respectively, but this
568600
/// type alias chooses the concrete types of KeysManager and DefaultRouter.
569601
///
570-
/// (C-not exported) as Arcs don't make sense in bindings
602+
603+
/// (This is not exported to bindings users) as Arcs don't make sense in bindings
571604
pub type SimpleArcChannelManager<M, T, F, L> = ChannelManager<
572605
Arc<M>,
573606
Arc<T>,
@@ -592,7 +625,8 @@ pub type SimpleArcChannelManager<M, T, F, L> = ChannelManager<
592625
/// that implements KeysInterface or Router for its keys manager and router, respectively, but this
593626
/// type alias chooses the concrete types of KeysManager and DefaultRouter.
594627
///
595-
/// (C-not exported) as Arcs don't make sense in bindings
628+
629+
/// (This is not exported to bindings users) as Arcs don't make sense in bindings
596630
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>;
597631

598632
/// Manager which keeps track of a number of channels and sends messages to the appropriate
@@ -7208,8 +7242,8 @@ where
72087242
///
72097243
/// In such cases the latest local transactions will be sent to the tx_broadcaster included in
72107244
/// this struct.
7211-
///
7212-
/// (C-not exported) because we have no HashMap bindings
7245+
7246+
/// (This is not exported to bindings users) because we have no HashMap bindings
72137247
pub channel_monitors: HashMap<OutPoint, &'a mut ChannelMonitor<<SP::Target as SignerProvider>::Signer>>,
72147248
}
72157249

lightning/src/ln/features.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -393,7 +393,8 @@ mod sealed {
393393
/// Tracks the set of features which a node implements, templated by the context in which it
394394
/// appears.
395395
///
396-
/// (C-not exported) as we map the concrete feature types below directly instead
396+
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)
@@ -622,7 +623,8 @@ impl<T: sealed::Context> Features<T> {
622623

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.
625-
/// (C-not exported) as we don't support export across multiple T
626+
627+
/// (This is not exported to bindings users) as we don't support export across multiple T
626628
pub fn from_le_bytes(flags: Vec<u8>) -> Features<T> {
627629
Features {
628630
flags,

lightning/src/ln/mod.rs

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,15 +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-
/// (C-not exported) as we just use [u8; 32] directly
85+
///
86+
87+
/// (This is not exported to bindings users) as we just use [u8; 32] directly
8688
#[derive(Hash, Copy, Clone, PartialEq, Eq, Debug)]
8789
pub struct PaymentHash(pub [u8; 32]);
8890
/// payment_preimage type, use to route payment between hop
89-
/// (C-not exported) as we just use [u8; 32] directly
91+
///
92+
93+
/// (This is not exported to bindings users) as we just use [u8; 32] directly
9094
#[derive(Hash, Copy, Clone, PartialEq, Eq, Debug)]
9195
pub struct PaymentPreimage(pub [u8; 32]);
9296
/// payment_secret type, use to authenticate sender to the receiver and tie MPP HTLCs together
93-
/// (C-not exported) as we just use [u8; 32] directly
97+
///
98+
99+
/// (This is not exported to bindings users) as we just use [u8; 32] directly
94100
#[derive(Hash, Copy, Clone, PartialEq, Eq, Debug)]
95101
pub struct PaymentSecret(pub [u8; 32]);
96102

lightning/src/ln/msgs.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -939,7 +939,8 @@ pub struct CommitmentUpdate {
939939
/// [`OptionalField`] simply gets `Present` if there are enough bytes to read into it), we have a
940940
/// separate enum type for them.
941941
///
942-
/// (C-not exported) due to a free generic in `T`
942+
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)