Trait Encodable

Source
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

Implementors§