X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;ds=sidebyside;f=lightning%2Fsrc%2Futil%2Fser.rs;h=ecf85839a5a8e19ebfed3f8e87b8b5832427e4a5;hb=7717fa23a8cccdd31afa086f5c2487e9ba90bbfc;hp=5b1a86a6a95f27a276f1dc221bd705f57fbf8ed4;hpb=29e34c8a10cf813116c9251188a86978cc97e259;p=rust-lightning
diff --git a/lightning/src/util/ser.rs b/lightning/src/util/ser.rs
index 5b1a86a6..ecf85839 100644
--- a/lightning/src/util/ser.rs
+++ b/lightning/src/util/ser.rs
@@ -244,6 +244,14 @@ pub(crate) trait LengthReadableArgs
where Self: Sized
fn read(reader: &mut R, params: P) -> Result;
}
+/// A trait that various higher-level rust-lightning types implement allowing them to be read in
+/// from a Read, requiring the implementer to provide the total length of the read.
+pub(crate) trait LengthReadable where Self: Sized
+{
+ /// Reads a Self in from the given LengthRead
+ fn read(reader: &mut R) -> Result;
+}
+
/// A trait that various rust-lightning types implement allowing them to (maybe) be read in from a Read
///
/// (C-not exported) as we only export serialization to/from byte arrays instead