Skip to main content

Encoder

Trait Encoder 

Source
pub trait Encoder:
    Send
    + Sync
    + 'static {
    // Provided method
    fn encode<T>(&self, value: &T) -> Result<Bytes, BoxError>
       where Self: EncodeValue<T> { ... }
}
Expand description

An encoder that can serialize a value into a byte stream.

Provided Methods§

Source

fn encode<T>(&self, value: &T) -> Result<Bytes, BoxError>
where Self: EncodeValue<T>,

Encode a value into bytes.

§Errors

Returns an error if serialization fails.

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.

Implementations on Foreign Types§

Source§

impl<C> Encoder for Arc<C>
where C: Encoder,

Implementors§