Skip to content

Commit 40fcfaf

Browse files
committed
Tag types used for the TLV macros with (C-not exported)
Obviously bindings users can't use the Rust TLV-implementation macros, so there's no reason to export typsed used exclusively by them.
1 parent 08cb01e commit 40fcfaf

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

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)