Encode

Trait Encode 

Source
pub trait Encode: Sealed + Sized {
    type Output: IntoResponse;

    // Required method
    fn encode(self, buf: &mut BytesMut) -> Result<Self::Output, Error>;
}
Expand description

trait for generic over how to encode a query. currently this trait can not be implement by library user.

Required Associated Types§

Source

type Output: IntoResponse

output type defines how a potential async row streaming type should be constructed. certain state from the encode type may need to be passed for constructing the stream

Required Methods§

Source

fn encode(self, buf: &mut BytesMut) -> Result<Self::Output, Error>

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§

type Output = Vec<Column>

Source§

fn encode(self, buf: &mut BytesMut) -> Result<Self::Output, Error>

Implementors§

Source§

impl<'s, P> Encode for StatementPreparedQuery<'s, P>
where P: AsParams,

Source§

type Output = &'s [Column]

Source§

impl<'s, P> Encode for StatementPreparedQueryOwned<'s, P>
where P: AsParams,