xitca_postgres::dev

Trait Encode

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

    // Required method
    fn encode<const SYNC_MODE: bool>(
        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<const SYNC_MODE: bool>( self, buf: &mut BytesMut, ) -> Result<Self::Output, Error>

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl Encode for &str

source§

type Output = Vec<Column>

source§

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

Implementors§

source§

impl<'s> Encode for &'s Statement

source§

type Output = &'s [Column]

source§

impl<'s> Encode for PipelineQuery<'s, '_>

source§

type Output = Vec<&'s [Column]>

source§

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

source§

type Output = &'s [Column]