pub trait LightningEncode {
    fn lightning_encode<E: Write>(&self, e: E) -> Result<usize, Error>;

    fn lightning_serialize(&self) -> Result<Vec<u8>, Error> { ... }
}
Expand description

Lightning-network specific encoding as defined in BOLT-1, 2, 3…

Required Methods

Encode with the given std::io::Write instance; must return result with either amount of bytes encoded – or implementation-specific error type.

Provided Methods

Serializes data as a byte array using LightningEncode::lightning_encode function.

Implementations on Foreign Types

Two-component tuples are encoded as they were fields in the parent data structure

Implementors