Skip to main content

ToDbValue

Trait ToDbValue 

Source
pub trait ToDbValue: ToBuf {
    // Required method
    fn db_type(&self) -> &'static DbType;

    // Provided method
    fn max_size(&self) -> usize { ... }
}
Expand description

Trait which transforms values used by applications into the format required by the database.

Required Methods§

Source

fn db_type(&self) -> &'static DbType

Provided Methods§

Source

fn max_size(&self) -> usize

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl ToDbValue for &[u8]

Source§

fn db_type(&self) -> &'static DbType

Source§

fn max_size(&self) -> usize

Source§

impl ToDbValue for &str

Source§

fn db_type(&self) -> &'static DbType

Source§

fn max_size(&self) -> usize

Source§

impl ToDbValue for String

Source§

fn db_type(&self) -> &'static DbType

Source§

fn max_size(&self) -> usize

Source§

impl ToDbValue for Vec<u8>

Source§

fn db_type(&self) -> &'static DbType

Source§

fn max_size(&self) -> usize

Source§

impl ToDbValue for bool

Source§

fn db_type(&self) -> &'static DbType

Source§

impl ToDbValue for f32

Source§

fn db_type(&self) -> &'static DbType

Source§

impl ToDbValue for f64

Source§

fn db_type(&self) -> &'static DbType

Source§

impl ToDbValue for i8

Source§

fn db_type(&self) -> &'static DbType

Source§

impl ToDbValue for i16

Source§

fn db_type(&self) -> &'static DbType

Source§

impl ToDbValue for i32

Source§

fn db_type(&self) -> &'static DbType

Source§

impl ToDbValue for i64

Source§

fn db_type(&self) -> &'static DbType

Source§

impl ToDbValue for i128

Source§

fn db_type(&self) -> &'static DbType

Source§

impl ToDbValue for isize

Source§

fn db_type(&self) -> &'static DbType

Source§

impl ToDbValue for u8

Source§

fn db_type(&self) -> &'static DbType

Source§

impl ToDbValue for u16

Source§

fn db_type(&self) -> &'static DbType

Source§

impl ToDbValue for u32

Source§

fn db_type(&self) -> &'static DbType

Source§

impl ToDbValue for u64

Source§

fn db_type(&self) -> &'static DbType

Source§

impl ToDbValue for u128

Source§

fn db_type(&self) -> &'static DbType

Source§

impl ToDbValue for usize

Source§

fn db_type(&self) -> &'static DbType

Source§

impl<T> ToDbValue for Option<T>
where T: ToDbValue + Default,

Source§

fn db_type(&self) -> &'static DbType

Source§

fn max_size(&self) -> usize

Implementors§