Trait lightning::util::ser::Writeable[][src]

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 encode_with_len(&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

Writes self out to the given Writer

Provided methods

Writes self out to a Vec

Writes self out to a Vec

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.

Implementations on Foreign Types

Implementors