Trait ToRow

Source
pub trait ToRow {
    // Required methods
    fn insert_columns(&self, s: &mut String);
    fn insert_values(&self, s: &mut String);
    fn update_columns(&self, s: &mut String);
    fn params_len(&self) -> usize;
    fn params(&self) -> impl ExactSizeIterator<Item = &(dyn ToSql + Sync)>;
}

Required Methods§

Source

fn insert_columns(&self, s: &mut String)

should return something like “id”, “name”, “email”

Source

fn insert_values(&self, s: &mut String)

should return something like $1, $2, $3

Source

fn update_columns(&self, s: &mut String)

should return something like “id” = $1, “name” = $2

Source

fn params_len(&self) -> usize

Source

fn params(&self) -> impl ExactSizeIterator<Item = &(dyn ToSql + Sync)>

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.

Implementors§

Source§

impl ToRow for RowBuilder<'_>

Source§

impl<S> ToRow for S
where S: ToRowStatic,