X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=src%2Futil%2Fser.rs;h=5429c0e664eb655cb588383cda1a8d5b90937491;hb=062a02da1a93e45e043c9cfeddae09998abe8c6b;hp=92cc66b81e30af9599f35bcd8cec1bcb088d2713;hpb=c43e535bc03404bad16e3d30e5b2fc7215e6ca15;p=rust-lightning diff --git a/src/util/ser.rs b/src/util/ser.rs index 92cc66b8..5429c0e6 100644 --- a/src/util/ser.rs +++ b/src/util/ser.rs @@ -82,6 +82,16 @@ pub trait Readable fn read(reader: &mut R) -> Result; } +/// A trait that various higher-level rust-lightning types implement allowing them to be read in +/// from a Read given some additional set of arguments which is required to deserialize. +pub trait ReadableArgs + where Self: Sized, + R: Read +{ + /// Reads a Self in from the given Read + fn read(reader: &mut R, params: P) -> Result; +} + macro_rules! impl_writeable_primitive { ($val_type:ty, $meth_write:ident, $len: expr, $meth_read:ident) => { impl Writeable for $val_type {