Skip to content

Commit 04ce6de

Browse files
authored
Merge pull request #2061 from TheBlueMatt/2023-02-114-upstream-bindings
`C-not exported` tags for 0.0.114
2 parents 0b1a64f + 40fcfaf commit 04ce6de

File tree

2 files changed

+22
-0
lines changed

2 files changed

+22
-0
lines changed

lightning/src/util/indexed_map.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ use core::ops::{Bound, RangeBounds};
2121
/// actually backed by a [`HashMap`], with some additional tracking to ensure we can iterate over
2222
/// keys in the order defined by [`Ord`].
2323
///
24+
/// (C-not exported) as bindings provide alternate accessors rather than exposing maps directly.
25+
///
2426
/// [`BTreeMap`]: alloc::collections::BTreeMap
2527
#[derive(Clone, Debug, Eq)]
2628
pub struct IndexedMap<K: Hash + Ord, V> {
@@ -147,6 +149,8 @@ impl<K: Hash + Ord + PartialEq, V: PartialEq> PartialEq for IndexedMap<K, V> {
147149
}
148150

149151
/// An iterator over a range of values in an [`IndexedMap`]
152+
///
153+
/// (C-not exported) as bindings provide alternate accessors rather than exposing maps directly.
150154
pub struct Range<'a, K: Hash + Ord, V> {
151155
inner_range: Iter<'a, K>,
152156
map: &'a HashMap<K, V>,
@@ -161,6 +165,8 @@ impl<'a, K: Hash + Ord, V: 'a> Iterator for Range<'a, K, V> {
161165
}
162166

163167
/// An [`Entry`] for a key which currently has no value
168+
///
169+
/// (C-not exported) as bindings provide alternate accessors rather than exposing maps directly.
164170
pub struct VacantEntry<'a, K: Hash + Ord, V> {
165171
#[cfg(feature = "hashbrown")]
166172
underlying_entry: hash_map::VacantEntry<'a, K, V, hash_map::DefaultHashBuilder>,
@@ -171,6 +177,8 @@ pub struct VacantEntry<'a, K: Hash + Ord, V> {
171177
}
172178

173179
/// An [`Entry`] for an existing key-value pair
180+
///
181+
/// (C-not exported) as bindings provide alternate accessors rather than exposing maps directly.
174182
pub struct OccupiedEntry<'a, K: Hash + Ord, V> {
175183
#[cfg(feature = "hashbrown")]
176184
underlying_entry: hash_map::OccupiedEntry<'a, K, V, hash_map::DefaultHashBuilder>,
@@ -181,6 +189,8 @@ pub struct OccupiedEntry<'a, K: Hash + Ord, V> {
181189

182190
/// A mutable reference to a position in the map. This can be used to reference, add, or update the
183191
/// value at a fixed key.
192+
///
193+
/// (C-not exported) as bindings provide alternate accessors rather than exposing maps directly.
184194
pub enum Entry<'a, K: Hash + Ord, V> {
185195
/// A mutable reference to a position within the map where there is no value.
186196
Vacant(VacantEntry<'a, K, V>),

lightning/src/util/ser.rs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,8 @@ impl Writer for VecWriter {
8989

9090
/// Writer that only tracks the amount of data written - useful if you need to calculate the length
9191
/// of some data when serialized but don't yet need the full data.
92+
///
93+
/// (C-not exported) as manual TLV building is not currently supported in bindings
9294
pub struct LengthCalculatingWriter(pub usize);
9395
impl Writer for LengthCalculatingWriter {
9496
#[inline]
@@ -100,6 +102,8 @@ impl Writer for LengthCalculatingWriter {
100102

101103
/// Essentially [`std::io::Take`] but a bit simpler and with a method to walk the underlying stream
102104
/// forward to ensure we always consume exactly the fixed length specified.
105+
///
106+
/// (C-not exported) as manual TLV building is not currently supported in bindings
103107
pub struct FixedLengthReader<R: Read> {
104108
read: R,
105109
bytes_read: u64,
@@ -155,6 +159,8 @@ impl<R: Read> LengthRead for FixedLengthReader<R> {
155159

156160
/// A [`Read`] implementation which tracks whether any bytes have been read at all. This allows us to distinguish
157161
/// between "EOF reached before we started" and "EOF reached mid-read".
162+
///
163+
/// (C-not exported) as manual TLV building is not currently supported in bindings
158164
pub struct ReadTrackingReader<R: Read> {
159165
read: R,
160166
/// Returns whether we have read from this reader or not yet.
@@ -289,6 +295,8 @@ impl<T: Readable> MaybeReadable for T {
289295
}
290296

291297
/// Wrapper to read a required (non-optional) TLV record.
298+
///
299+
/// (C-not exported) as manual TLV building is not currently supported in bindings
292300
pub struct RequiredWrapper<T>(pub Option<T>);
293301
impl<T: Readable> Readable for RequiredWrapper<T> {
294302
#[inline]
@@ -311,6 +319,8 @@ impl<T> From<T> for RequiredWrapper<T> {
311319

312320
/// Wrapper to read a required (non-optional) TLV record that may have been upgraded without
313321
/// backwards compat.
322+
///
323+
/// (C-not exported) as manual TLV building is not currently supported in bindings
314324
pub struct UpgradableRequired<T: MaybeReadable>(pub Option<T>);
315325
impl<T: MaybeReadable> MaybeReadable for UpgradableRequired<T> {
316326
#[inline]
@@ -591,6 +601,8 @@ impl Readable for [u16; 8] {
591601

592602
/// A type for variable-length values within TLV record where the length is encoded as part of the record.
593603
/// Used to prevent encoding the length twice.
604+
///
605+
/// (C-not exported) as manual TLV building is not currently supported in bindings
594606
pub struct WithoutLength<T>(pub T);
595607

596608
impl Writeable for WithoutLength<&String> {

0 commit comments

Comments
 (0)