X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=lightning%2Fsrc%2Futil%2Fser.rs;fp=lightning%2Fsrc%2Futil%2Fser.rs;h=bef192585b5e486696068174b92539c0faa895ff;hb=40fcfafef212179a7f90bc0cd80d2e3b1ae6587d;hp=14c25775174b19dc50f4dabe5ecb434ce0ea259b;hpb=08cb01e6ef9f6bfe0251c167acb89d7051c5da59;p=rust-lightning diff --git a/lightning/src/util/ser.rs b/lightning/src/util/ser.rs index 14c25775..bef19258 100644 --- a/lightning/src/util/ser.rs +++ b/lightning/src/util/ser.rs @@ -89,6 +89,8 @@ 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 pub struct LengthCalculatingWriter(pub usize); impl Writer for LengthCalculatingWriter { #[inline] @@ -100,6 +102,8 @@ 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 pub struct FixedLengthReader { read: R, bytes_read: u64, @@ -155,6 +159,8 @@ 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 pub struct ReadTrackingReader { read: R, /// Returns whether we have read from this reader or not yet. @@ -289,6 +295,8 @@ 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 pub struct RequiredWrapper(pub Option); impl Readable for RequiredWrapper { #[inline] @@ -311,6 +319,8 @@ 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 pub struct UpgradableRequired(pub Option); impl MaybeReadable for UpgradableRequired { #[inline] @@ -591,6 +601,8 @@ 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 pub struct WithoutLength(pub T); impl Writeable for WithoutLength<&String> {