Trait ToMysqlValue

Source
pub trait ToMysqlValue {
    // Required methods
    fn to_mysql_text<W: Write>(&self, w: &mut W) -> Result<()>;
    fn to_mysql_bin<W: Write>(&self, w: &mut W, c: &Column) -> Result<()>;

    // Provided method
    fn is_null(&self) -> bool { ... }
}
Expand description

Implementors of this trait can be sent as a single resultset value to a MySQL/MariaDB client.

Required Methods§

Source

fn to_mysql_text<W: Write>(&self, w: &mut W) -> Result<()>

Encode value using the text-based protocol.

Source

fn to_mysql_bin<W: Write>(&self, w: &mut W, c: &Column) -> Result<()>

Encode value using the binary protocol.

Provided Methods§

Source

fn is_null(&self) -> bool

Is this value NULL?

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 ToMysqlValue for Value

Source§

fn to_mysql_text<W: Write>(&self, w: &mut W) -> Result<()>

Source§

fn to_mysql_bin<W: Write>(&self, w: &mut W, c: &Column) -> Result<()>

Source§

fn is_null(&self) -> bool

Source§

impl ToMysqlValue for f32

Source§

fn to_mysql_text<W: Write>(&self, w: &mut W) -> Result<()>

Source§

fn to_mysql_bin<W: Write>(&self, w: &mut W, c: &Column) -> Result<()>

Source§

impl ToMysqlValue for f64

Source§

fn to_mysql_text<W: Write>(&self, w: &mut W) -> Result<()>

Source§

fn to_mysql_bin<W: Write>(&self, w: &mut W, c: &Column) -> Result<()>

Source§

impl ToMysqlValue for i8

Source§

fn to_mysql_text<W: Write>(&self, w: &mut W) -> Result<()>

Source§

fn to_mysql_bin<W: Write>(&self, w: &mut W, c: &Column) -> Result<()>

Source§

impl ToMysqlValue for i16

Source§

fn to_mysql_text<W: Write>(&self, w: &mut W) -> Result<()>

Source§

fn to_mysql_bin<W: Write>(&self, w: &mut W, c: &Column) -> Result<()>

Source§

impl ToMysqlValue for i32

Source§

fn to_mysql_text<W: Write>(&self, w: &mut W) -> Result<()>

Source§

fn to_mysql_bin<W: Write>(&self, w: &mut W, c: &Column) -> Result<()>

Source§

impl ToMysqlValue for i64

Source§

fn to_mysql_text<W: Write>(&self, w: &mut W) -> Result<()>

Source§

fn to_mysql_bin<W: Write>(&self, w: &mut W, c: &Column) -> Result<()>

Source§

impl ToMysqlValue for isize

Source§

fn to_mysql_text<W: Write>(&self, w: &mut W) -> Result<()>

Source§

fn to_mysql_bin<W: Write>(&self, w: &mut W, c: &Column) -> Result<()>

Source§

impl ToMysqlValue for str

Source§

fn to_mysql_text<W: Write>(&self, w: &mut W) -> Result<()>

Source§

fn to_mysql_bin<W: Write>(&self, w: &mut W, c: &Column) -> Result<()>

Source§

impl ToMysqlValue for u8

Source§

fn to_mysql_text<W: Write>(&self, w: &mut W) -> Result<()>

Source§

fn to_mysql_bin<W: Write>(&self, w: &mut W, c: &Column) -> Result<()>

Source§

impl ToMysqlValue for u16

Source§

fn to_mysql_text<W: Write>(&self, w: &mut W) -> Result<()>

Source§

fn to_mysql_bin<W: Write>(&self, w: &mut W, c: &Column) -> Result<()>

Source§

impl ToMysqlValue for u32

Source§

fn to_mysql_text<W: Write>(&self, w: &mut W) -> Result<()>

Source§

fn to_mysql_bin<W: Write>(&self, w: &mut W, c: &Column) -> Result<()>

Source§

impl ToMysqlValue for u64

Source§

fn to_mysql_text<W: Write>(&self, w: &mut W) -> Result<()>

Source§

fn to_mysql_bin<W: Write>(&self, w: &mut W, c: &Column) -> Result<()>

Source§

impl ToMysqlValue for usize

Source§

fn to_mysql_text<W: Write>(&self, w: &mut W) -> Result<()>

Source§

fn to_mysql_bin<W: Write>(&self, w: &mut W, c: &Column) -> Result<()>

Source§

impl ToMysqlValue for String

Source§

fn to_mysql_text<W: Write>(&self, w: &mut W) -> Result<()>

Source§

fn to_mysql_bin<W: Write>(&self, w: &mut W, c: &Column) -> Result<()>

Source§

impl ToMysqlValue for Vec<u8>

Source§

fn to_mysql_text<W: Write>(&self, w: &mut W) -> Result<()>

Source§

fn to_mysql_bin<W: Write>(&self, w: &mut W, c: &Column) -> Result<()>

Source§

impl ToMysqlValue for Duration

Source§

fn to_mysql_text<W: Write>(&self, w: &mut W) -> Result<()>

Source§

fn to_mysql_bin<W: Write>(&self, w: &mut W, c: &Column) -> Result<()>

Source§

impl ToMysqlValue for NaiveDate

Source§

fn to_mysql_text<W: Write>(&self, w: &mut W) -> Result<()>

Source§

fn to_mysql_bin<W: Write>(&self, w: &mut W, c: &Column) -> Result<()>

Source§

impl ToMysqlValue for NaiveDateTime

Source§

fn to_mysql_text<W: Write>(&self, w: &mut W) -> Result<()>

Source§

fn to_mysql_bin<W: Write>(&self, w: &mut W, c: &Column) -> Result<()>

Source§

impl ToMysqlValue for [u8]

Source§

fn to_mysql_text<W: Write>(&self, w: &mut W) -> Result<()>

Source§

fn to_mysql_bin<W: Write>(&self, w: &mut W, c: &Column) -> Result<()>

Source§

impl<'a, T> ToMysqlValue for &'a T
where T: ToMysqlValue + ?Sized,

Source§

fn to_mysql_text<W: Write>(&self, w: &mut W) -> Result<()>

Source§

fn to_mysql_bin<W: Write>(&self, w: &mut W, c: &Column) -> Result<()>

Source§

impl<T> ToMysqlValue for Option<T>
where T: ToMysqlValue,

Source§

fn to_mysql_text<W: Write>(&self, w: &mut W) -> Result<()>

Source§

fn to_mysql_bin<W: Write>(&self, w: &mut W, ct: &Column) -> Result<()>

Source§

fn is_null(&self) -> bool

Implementors§