Skip to main content

Encoder

Trait Encoder 

Source
pub trait Encoder {
    type Item;

    // Required methods
    fn encode_field<T>(
        &mut self,
        value: &T,
        pg_field: &FieldInfo,
    ) -> PgWireResult<()>
       where T: ToSql + ToSqlText + Sized;
    fn take_row(&mut self) -> Self::Item;
}

Required Associated Types§

Required Methods§

Source

fn encode_field<T>( &mut self, value: &T, pg_field: &FieldInfo, ) -> PgWireResult<()>
where T: ToSql + ToSqlText + Sized,

Source

fn take_row(&mut self) -> Self::Item

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 Encoder for CopyEncoder

Source§

type Item = CopyData

Source§

fn encode_field<T>( &mut self, value: &T, _pg_field: &FieldInfo, ) -> PgWireResult<()>
where T: ToSql + ToSqlText + Sized,

Source§

fn take_row(&mut self) -> Self::Item

Source§

impl Encoder for DataRowEncoder

Source§

type Item = DataRow

Source§

fn encode_field<T>( &mut self, value: &T, pg_field: &FieldInfo, ) -> PgWireResult<()>
where T: ToSql + ToSqlText + Sized,

Source§

fn take_row(&mut self) -> Self::Item

Implementors§