Trait Encodable

Source
pub trait Encodable {
    // Required method
    fn encode<Consumer>(
        &self,
        consumer: &mut Consumer,
    ) -> impl Future<Output = Result<(), Consumer::Error>>
       where Consumer: BulkConsumer<Item = u8>;
}
Expand description

A type that can be encoded to a bytestring, ensuring that any value of Self maps to exactly one bytestring.

Definition

Required Methods§

Source

fn encode<Consumer>( &self, consumer: &mut Consumer, ) -> impl Future<Output = Result<(), Consumer::Error>>
where Consumer: BulkConsumer<Item = u8>,

Encode a value to a bytestring in a specific way that is best described over at willowprotocol.org.

Definition

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§