sqlx_core::io

Trait ProtocolEncode

Source
pub trait ProtocolEncode<'en, Context = ()> {
    // Required method
    fn encode_with(
        &self,
        buf: &mut Vec<u8>,
        context: Context,
    ) -> Result<(), Error>;

    // Provided method
    fn encode(&self, buf: &mut Vec<u8>) -> Result<(), Error>
       where Self: ProtocolEncode<'en, ()> { ... }
}

Required Methods§

Source

fn encode_with(&self, buf: &mut Vec<u8>, context: Context) -> Result<(), Error>

Provided Methods§

Source

fn encode(&self, buf: &mut Vec<u8>) -> Result<(), Error>
where Self: ProtocolEncode<'en, ()>,

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<'en, C> ProtocolEncode<'en, C> for &[u8]

Source§

fn encode_with(&self, buf: &mut Vec<u8>, _context: C) -> Result<(), Error>

Implementors§