Trait microrm::model::Modelable

source ·
pub trait Modelable {
    // Required method
    fn bind_to(&self, stmt: &mut Statement<'_>, col: usize) -> Result<()>;

    // Provided methods
    fn build_from(
        _stmt: &Statement<'_>,
        _col_offset: usize
    ) -> Result<(Self, usize)>
       where Self: Sized { ... }
    fn column_type() -> &'static str
       where Self: Sized { ... }
}
Expand description

A database value, aka a single column of a single row

Required Methods§

source

fn bind_to(&self, stmt: &mut Statement<'_>, col: usize) -> Result<()>

Provided Methods§

source

fn build_from( _stmt: &Statement<'_>, _col_offset: usize ) -> Result<(Self, usize)>
where Self: Sized,

source

fn column_type() -> &'static str
where Self: Sized,

Implementations on Foreign Types§

source§

impl Modelable for bool

source§

fn bind_to(&self, stmt: &mut Statement<'_>, col: usize) -> Result<()>

source§

fn build_from(stmt: &Statement<'_>, col_offset: usize) -> Result<(Self, usize)>
where Self: Sized,

source§

fn column_type() -> &'static str
where Self: Sized,

source§

impl Modelable for f64

source§

fn bind_to(&self, stmt: &mut Statement<'_>, col: usize) -> Result<()>

source§

fn build_from(stmt: &Statement<'_>, col_offset: usize) -> Result<(Self, usize)>
where Self: Sized,

source§

fn column_type() -> &'static str
where Self: Sized,

source§

impl Modelable for i8

source§

fn bind_to(&self, stmt: &mut Statement<'_>, col: usize) -> Result<()>

source§

fn build_from(stmt: &Statement<'_>, col_offset: usize) -> Result<(Self, usize)>
where Self: Sized,

source§

fn column_type() -> &'static str
where Self: Sized,

source§

impl Modelable for i16

source§

fn bind_to(&self, stmt: &mut Statement<'_>, col: usize) -> Result<()>

source§

fn build_from(stmt: &Statement<'_>, col_offset: usize) -> Result<(Self, usize)>
where Self: Sized,

source§

fn column_type() -> &'static str
where Self: Sized,

source§

impl Modelable for i32

source§

fn bind_to(&self, stmt: &mut Statement<'_>, col: usize) -> Result<()>

source§

fn build_from(stmt: &Statement<'_>, col_offset: usize) -> Result<(Self, usize)>
where Self: Sized,

source§

fn column_type() -> &'static str
where Self: Sized,

source§

impl Modelable for i64

source§

fn bind_to(&self, stmt: &mut Statement<'_>, col: usize) -> Result<()>

source§

fn build_from(stmt: &Statement<'_>, col_offset: usize) -> Result<(Self, usize)>
where Self: Sized,

source§

fn column_type() -> &'static str
where Self: Sized,

source§

impl Modelable for str

source§

fn bind_to(&self, stmt: &mut Statement<'_>, col: usize) -> Result<()>

source§

impl Modelable for u8

source§

fn bind_to(&self, stmt: &mut Statement<'_>, col: usize) -> Result<()>

source§

fn build_from(stmt: &Statement<'_>, col_offset: usize) -> Result<(Self, usize)>
where Self: Sized,

source§

fn column_type() -> &'static str
where Self: Sized,

source§

impl Modelable for u16

source§

fn bind_to(&self, stmt: &mut Statement<'_>, col: usize) -> Result<()>

source§

fn build_from(stmt: &Statement<'_>, col_offset: usize) -> Result<(Self, usize)>
where Self: Sized,

source§

fn column_type() -> &'static str
where Self: Sized,

source§

impl Modelable for u32

source§

fn bind_to(&self, stmt: &mut Statement<'_>, col: usize) -> Result<()>

source§

fn build_from(stmt: &Statement<'_>, col_offset: usize) -> Result<(Self, usize)>
where Self: Sized,

source§

fn column_type() -> &'static str
where Self: Sized,

source§

impl Modelable for u64

source§

fn bind_to(&self, stmt: &mut Statement<'_>, col: usize) -> Result<()>

source§

fn build_from(stmt: &Statement<'_>, col_offset: usize) -> Result<(Self, usize)>
where Self: Sized,

source§

fn column_type() -> &'static str
where Self: Sized,

source§

impl Modelable for usize

source§

fn bind_to(&self, stmt: &mut Statement<'_>, col: usize) -> Result<()>

source§

fn build_from(stmt: &Statement<'_>, col_offset: usize) -> Result<(Self, usize)>
where Self: Sized,

source§

fn column_type() -> &'static str
where Self: Sized,

source§

impl Modelable for String

source§

fn bind_to(&self, stmt: &mut Statement<'_>, col: usize) -> Result<()>

source§

fn build_from(stmt: &Statement<'_>, col_offset: usize) -> Result<(Self, usize)>
where Self: Sized,

source§

fn column_type() -> &'static str
where Self: Sized,

source§

impl<'a> Modelable for &'a str

source§

fn bind_to(&self, stmt: &mut Statement<'_>, col: usize) -> Result<()>

source§

fn build_from( _stmt: &Statement<'_>, _col_offset: usize ) -> Result<(Self, usize)>
where Self: Sized,

source§

fn column_type() -> &'static str
where Self: Sized,

source§

impl<'a> Modelable for &'a [u8]

source§

fn bind_to(&self, stmt: &mut Statement<'_>, col: usize) -> Result<()>

source§

fn build_from( _stmt: &Statement<'_>, _col_offset: usize ) -> Result<(Self, usize)>
where Self: Sized,

source§

fn column_type() -> &'static str
where Self: Sized,

source§

impl<'a, T: Modelable> Modelable for &'a T

source§

fn bind_to(&self, stmt: &mut Statement<'_>, col: usize) -> Result<()>

source§

fn build_from( _stmt: &Statement<'_>, _col_offset: usize ) -> Result<(Self, usize)>
where Self: Sized,

source§

fn column_type() -> &'static str
where Self: Sized,

source§

impl<T: Modelable + Serialize + DeserializeOwned + 'static> Modelable for Vec<T>

source§

fn bind_to(&self, stmt: &mut Statement<'_>, col: usize) -> Result<()>

source§

fn build_from(stmt: &Statement<'_>, col_offset: usize) -> Result<(Self, usize)>
where Self: Sized,

source§

fn column_type() -> &'static str
where Self: Sized,

source§

impl<T: Modelable> Modelable for Option<T>

source§

fn bind_to(&self, stmt: &mut Statement<'_>, col: usize) -> Result<()>

source§

fn build_from(stmt: &Statement<'_>, col_offset: usize) -> Result<(Self, usize)>
where Self: Sized,

source§

fn column_type() -> &'static str
where Self: Sized,

Implementors§