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?

Implementations on Foreign Types§

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 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 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 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 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 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 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 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 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 [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 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 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<'a, T> ToMysqlValue for &'a Twhere 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 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 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 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 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 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<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

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 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<()>

Implementors§