pub enum MySQLValue<'a> {
Null,
Bytes(Cow<'a, [u8]>),
Int(i64),
UInt(u64),
Float(f32),
Double(f64),
Date {
year: u16,
month: u8,
day: u8,
hour: u8,
minute: u8,
second: u8,
microseconds: u32,
},
Time {
negative: bool,
days: u32,
hours: u8,
minutes: u8,
seconds: u8,
microseconds: u32,
},
}Expand description
A value in one of MySQL’s wire categories, possibly borrowing its bytes.
Used for bound parameters and for cells read from a row. The variants
mirror the values of the mysql and mysql_async clients, so this crate
does not depend on either. See OwnedMySQLValue for an owned form.
Variants§
Null
SQL NULL.
Bytes(Cow<'a, [u8]>)
Text, binary, decimal, JSON, enum, and set payloads.
Int(i64)
Signed integer payload.
UInt(u64)
Unsigned integer payload.
Float(f32)
Single-precision floating-point payload.
Double(f64)
Double-precision floating-point payload.
Date
Date, datetime, or timestamp payload.
Fields
Time
Time or duration payload.
Implementations§
Source§impl MySQLValue<'_>
impl MySQLValue<'_>
Sourcepub fn as_bytes(&self) -> Option<&[u8]>
pub fn as_bytes(&self) -> Option<&[u8]>
Returns the bytes of a Bytes value (text, binary,
decimal, JSON, enum or set), or None for other variants.
Sourcepub fn as_ref(&self) -> MySQLValue<'_>
pub fn as_ref(&self) -> MySQLValue<'_>
Returns a borrowed view of this value.
Sourcepub fn into_owned(self) -> OwnedMySQLValue
pub fn into_owned(self) -> OwnedMySQLValue
Converts this value into an owned representation.
Trait Implementations§
Source§impl<'a> Clone for MySQLValue<'a>
impl<'a> Clone for MySQLValue<'a>
Source§impl<'a> Debug for MySQLValue<'a>
impl<'a> Debug for MySQLValue<'a>
Source§impl<'a> Default for MySQLValue<'a>
impl<'a> Default for MySQLValue<'a>
Source§impl<'a, S, State, T, M, R, G> Expr<'a, MySQLValue<'a>> for SelectBuilder<'a, S, State, T, M, R, G>where
State: ClauseAllowed<Compound> + ExecutableState,
M: SubqueryType<'a, MySQLValue<'a>> + SelectSources,
impl<'a, S, State, T, M, R, G> Expr<'a, MySQLValue<'a>> for SelectBuilder<'a, S, State, T, M, R, G>where
State: ClauseAllowed<Compound> + ExecutableState,
M: SubqueryType<'a, MySQLValue<'a>> + SelectSources,
Source§type SQLType = <M as SubqueryType<'a, MySQLValue<'a>>>::SQLType
type SQLType = <M as SubqueryType<'a, MySQLValue<'a>>>::SQLType
The SQL data type this expression evaluates to.
Source§fn to_expr_sql(&self) -> SQL<'a, V>
fn to_expr_sql(&self) -> SQL<'a, V>
Renders this value as a scalar expression, borrowing it. Read more
Source§fn into_expr_sql(self) -> SQL<'a, V>where
Self: Sized,
fn into_expr_sql(self) -> SQL<'a, V>where
Self: Sized,
Renders this value as a scalar expression, consuming it.
Source§fn to_condition_sql(&self) -> Option<SQL<'a, V>>
fn to_condition_sql(&self) -> Option<SQL<'a, V>>
Renders this value as one element of a
ConditionList. Read moreSource§fn into_condition_sql(self) -> Option<SQL<'a, V>>where
Self: Sized,
fn into_condition_sql(self) -> Option<SQL<'a, V>>where
Self: Sized,
Consuming counterpart of
Expr::to_condition_sql.Source§impl<'a> From<&'a MySQLValue<'a>> for Cow<'a, MySQLValue<'a>>
impl<'a> From<&'a MySQLValue<'a>> for Cow<'a, MySQLValue<'a>>
Source§fn from(value: &'a MySQLValue<'a>) -> Self
fn from(value: &'a MySQLValue<'a>) -> Self
Converts to this type from the input type.
Source§impl<'a> From<&'a OwnedMySQLValue> for MySQLValue<'a>
impl<'a> From<&'a OwnedMySQLValue> for MySQLValue<'a>
Source§fn from(value: &'a OwnedMySQLValue) -> Self
fn from(value: &'a OwnedMySQLValue) -> Self
Converts to this type from the input type.
Source§impl<'a> From<&'a String> for MySQLValue<'a>
impl<'a> From<&'a String> for MySQLValue<'a>
Source§impl<'a> From<&'a [u8]> for MySQLValue<'a>
impl<'a> From<&'a [u8]> for MySQLValue<'a>
Source§impl<'a> From<&'a str> for MySQLValue<'a>
impl<'a> From<&'a str> for MySQLValue<'a>
Source§impl From<&bool> for MySQLValue<'_>
impl From<&bool> for MySQLValue<'_>
Source§impl From<&f32> for MySQLValue<'_>
impl From<&f32> for MySQLValue<'_>
Source§impl From<&f64> for MySQLValue<'_>
impl From<&f64> for MySQLValue<'_>
Source§impl From<&i8> for MySQLValue<'_>
impl From<&i8> for MySQLValue<'_>
Source§impl From<&i16> for MySQLValue<'_>
impl From<&i16> for MySQLValue<'_>
Source§impl From<&i32> for MySQLValue<'_>
impl From<&i32> for MySQLValue<'_>
Source§impl From<&i64> for MySQLValue<'_>
impl From<&i64> for MySQLValue<'_>
Source§impl From<&isize> for MySQLValue<'_>
impl From<&isize> for MySQLValue<'_>
Source§impl From<&u8> for MySQLValue<'_>
impl From<&u8> for MySQLValue<'_>
Source§impl From<&u16> for MySQLValue<'_>
impl From<&u16> for MySQLValue<'_>
Source§impl From<&u32> for MySQLValue<'_>
impl From<&u32> for MySQLValue<'_>
Source§impl From<&u64> for MySQLValue<'_>
impl From<&u64> for MySQLValue<'_>
Source§impl From<&usize> for MySQLValue<'_>
impl From<&usize> for MySQLValue<'_>
Source§impl<'a> From<MySQLValue<'a>> for Cow<'a, MySQLValue<'a>>
impl<'a> From<MySQLValue<'a>> for Cow<'a, MySQLValue<'a>>
Source§fn from(value: MySQLValue<'a>) -> Self
fn from(value: MySQLValue<'a>) -> Self
Converts to this type from the input type.
Source§impl<'a> From<MySQLValue<'a>> for OwnedMySQLValue
impl<'a> From<MySQLValue<'a>> for OwnedMySQLValue
Source§fn from(value: MySQLValue<'a>) -> Self
fn from(value: MySQLValue<'a>) -> Self
Converts to this type from the input type.
Source§impl<'a> From<MySQLValue<'a>> for SQL<'a, MySQLValue<'a>>
impl<'a> From<MySQLValue<'a>> for SQL<'a, MySQLValue<'a>>
Source§fn from(value: MySQLValue<'a>) -> Self
fn from(value: MySQLValue<'a>) -> Self
Converts to this type from the input type.
Source§impl<'a, T> From<Option<T>> for MySQLValue<'a>where
MySQLValue<'a>: From<T>,
impl<'a, T> From<Option<T>> for MySQLValue<'a>where
MySQLValue<'a>: From<T>,
Source§impl From<OwnedMySQLValue> for MySQLValue<'_>
impl From<OwnedMySQLValue> for MySQLValue<'_>
Source§fn from(value: OwnedMySQLValue) -> Self
fn from(value: OwnedMySQLValue) -> Self
Converts to this type from the input type.
Source§impl From<String> for MySQLValue<'_>
impl From<String> for MySQLValue<'_>
Source§impl<'a, T> From<T> for MySQLValue<'a>where
T: DrizzleMySQLColumn,
impl<'a, T> From<T> for MySQLValue<'a>where
T: DrizzleMySQLColumn,
Source§impl From<bool> for MySQLValue<'_>
impl From<bool> for MySQLValue<'_>
Source§impl From<char> for MySQLValue<'_>
impl From<char> for MySQLValue<'_>
Source§impl From<f32> for MySQLValue<'_>
impl From<f32> for MySQLValue<'_>
Source§impl From<f64> for MySQLValue<'_>
impl From<f64> for MySQLValue<'_>
Source§impl From<i8> for MySQLValue<'_>
impl From<i8> for MySQLValue<'_>
Source§impl From<i16> for MySQLValue<'_>
impl From<i16> for MySQLValue<'_>
Source§impl From<i32> for MySQLValue<'_>
impl From<i32> for MySQLValue<'_>
Source§impl From<i64> for MySQLValue<'_>
impl From<i64> for MySQLValue<'_>
Source§impl From<isize> for MySQLValue<'_>
impl From<isize> for MySQLValue<'_>
Source§impl From<u8> for MySQLValue<'_>
impl From<u8> for MySQLValue<'_>
Source§impl From<u16> for MySQLValue<'_>
impl From<u16> for MySQLValue<'_>
Source§impl From<u32> for MySQLValue<'_>
impl From<u32> for MySQLValue<'_>
Source§impl From<u64> for MySQLValue<'_>
impl From<u64> for MySQLValue<'_>
Source§impl From<usize> for MySQLValue<'_>
impl From<usize> for MySQLValue<'_>
Source§impl<'a> PartialEq for MySQLValue<'a>
impl<'a> PartialEq for MySQLValue<'a>
Source§impl SQLParam for MySQLValue<'_>
impl SQLParam for MySQLValue<'_>
Source§type DialectMarker = MySQLDialect
type DialectMarker = MySQLDialect
impl<'a> StructuralPartialEq for MySQLValue<'a>
Source§impl<'a, Schema, State, Table, Marker, Row, Grouped> ToSQL<'a, MySQLValue<'a>> for QueryBuilder<'a, Schema, State, Table, Marker, Row, Grouped>where
State: ExecutableState,
impl<'a, Schema, State, Table, Marker, Row, Grouped> ToSQL<'a, MySQLValue<'a>> for QueryBuilder<'a, Schema, State, Table, Marker, Row, Grouped>where
State: ExecutableState,
Source§impl<'a, T> ToSQL<'a, MySQLValue<'a>> for OrderExpr<T>where
T: ToSQL<'a, MySQLValue<'a>>,
impl<'a, T> ToSQL<'a, MySQLValue<'a>> for OrderExpr<T>where
T: ToSQL<'a, MySQLValue<'a>>,
Source§impl<'a> ToSQL<'a, MySQLValue<'a>> for OutputAlias
impl<'a> ToSQL<'a, MySQLValue<'a>> for OutputAlias
Auto Trait Implementations§
impl<'a> Freeze for MySQLValue<'a>
impl<'a> RefUnwindSafe for MySQLValue<'a>
impl<'a> Send for MySQLValue<'a>
impl<'a> Sync for MySQLValue<'a>
impl<'a> Unpin for MySQLValue<'a>
impl<'a> UnsafeUnpin for MySQLValue<'a>
impl<'a> UnwindSafe for MySQLValue<'a>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more