Trait Encode

Source
pub trait Encode {
    // Required methods
    fn encode<W>(
        &self,
        writer: &mut W,
    ) -> impl Future<Output = Result<(), Error>> + MaybeSend
       where W: Write;
    fn size(&self) -> usize;
}

Required Methods§

Source

fn encode<W>( &self, writer: &mut W, ) -> impl Future<Output = Result<(), Error>> + MaybeSend
where W: Write,

Source

fn size(&self) -> usize

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 Encode for &str

Source§

async fn encode<W>(&self, writer: &mut W) -> Result<(), Error>
where W: Write,

Source§

fn size(&self) -> usize

Source§

impl Encode for &[u8]

Source§

async fn encode<W: Write>(&self, writer: &mut W) -> Result<(), Error>

Source§

fn size(&self) -> usize

Source§

impl Encode for bool

Source§

async fn encode<W: Write>(&self, writer: &mut W) -> Result<(), Error>

Source§

fn size(&self) -> usize

Source§

impl Encode for f32

Source§

async fn encode<W: Write>(&self, writer: &mut W) -> Result<(), Error>

Source§

fn size(&self) -> usize

Source§

impl Encode for f64

Source§

async fn encode<W: Write>(&self, writer: &mut W) -> Result<(), Error>

Source§

fn size(&self) -> usize

Source§

impl Encode for i8

Source§

async fn encode<W: Write>(&self, writer: &mut W) -> Result<(), Error>

Source§

fn size(&self) -> usize

Source§

impl Encode for i16

Source§

async fn encode<W: Write>(&self, writer: &mut W) -> Result<(), Error>

Source§

fn size(&self) -> usize

Source§

impl Encode for i32

Source§

async fn encode<W: Write>(&self, writer: &mut W) -> Result<(), Error>

Source§

fn size(&self) -> usize

Source§

impl Encode for i64

Source§

async fn encode<W: Write>(&self, writer: &mut W) -> Result<(), Error>

Source§

fn size(&self) -> usize

Source§

impl Encode for u8

Source§

async fn encode<W: Write>(&self, writer: &mut W) -> Result<(), Error>

Source§

fn size(&self) -> usize

Source§

impl Encode for u16

Source§

async fn encode<W: Write>(&self, writer: &mut W) -> Result<(), Error>

Source§

fn size(&self) -> usize

Source§

impl Encode for u32

Source§

async fn encode<W: Write>(&self, writer: &mut W) -> Result<(), Error>

Source§

fn size(&self) -> usize

Source§

impl Encode for u64

Source§

async fn encode<W: Write>(&self, writer: &mut W) -> Result<(), Error>

Source§

fn size(&self) -> usize

Source§

impl Encode for String

Source§

async fn encode<W>(&self, writer: &mut W) -> Result<(), Error>
where W: Write,

Source§

fn size(&self) -> usize

Source§

impl Encode for Bytes

Source§

async fn encode<W: Write>(&self, writer: &mut W) -> Result<(), Error>

Source§

fn size(&self) -> usize

Source§

impl<T> Encode for Arc<T>
where T: Encode + Send + Sync,

Source§

async fn encode<W>(&self, writer: &mut W) -> Result<(), Error>
where W: Write,

Source§

fn size(&self) -> usize

Source§

impl<T> Encode for Vec<T>
where T: Encode + Send + Sync,

Source§

async fn encode<W>(&self, writer: &mut W) -> Result<(), Error>
where W: Write,

Source§

fn size(&self) -> usize

Source§

impl<T: Encode + Sync> Encode for &T

Source§

async fn encode<W>(&self, writer: &mut W) -> Result<(), Error>
where W: Write,

Source§

fn size(&self) -> usize

Source§

impl<V> Encode for Option<V>
where V: Encode + Sync,

Source§

async fn encode<W>(&self, writer: &mut W) -> Result<(), Error>
where W: Write,

Source§

fn size(&self) -> usize

Implementors§