pub trait Writeable {
fn write<W: Writer>(&self, writer: &mut W) -> Result<(), Error>;
fn encode(&self) -> Vec<u8>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
{ ... }
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
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.