Trait lightning::util::ser::Writeable [−][src]
pub trait Writeable { fn write<W: Writer>(&self, writer: &mut W) -> Result<(), Error>; fn encode(&self) -> Vec<u8>ⓘ { ... } fn encode_with_len(&self) -> Vec<u8>ⓘ { ... } fn serialized_length(&self) -> usize { ... } }
Expand description
A trait that various rust-lightning types implement allowing them to be written out to a Writer
(C-not exported) as we only export serialization to/from byte arrays instead
Required methods
Provided methods
Writes self out to a Vec
Writes self out to a Vec
fn serialized_length(&self) -> usize
fn serialized_length(&self) -> usize
Gets the length of this object after it has been serialized. This can be overridden to optimize cases where we prepend an object with its length.