pub trait Encodable {
    // Required method
    fn encode(&self) -> Vec<u8>;

    // Provided methods
    fn encode_bytes(&self) -> Bytes { ... }
    fn content_type(&self) -> Option<Cow<'_, str>> { ... }
}
Expand description

Determines how a request is encoded.

Required Methods§

source

fn encode(&self) -> Vec<u8>

Encode self into a byte array.

Provided Methods§

source

fn encode_bytes(&self) -> Bytes

Encode self into Bytes.

source

fn content_type(&self) -> Option<Cow<'_, str>>

Content type of this data.

Implementations on Foreign Types§

source§

impl Encodable for ()

source§

fn encode(&self) -> Vec<u8>

source§

impl Encodable for Bytes

source§

fn encode(&self) -> Vec<u8>

source§

fn encode_bytes(&self) -> Bytes

Implementors§