Enum Value

Source
pub enum Value {
    NULL,
    Bytes(Vec<u8>),
    Int(i64),
    UInt(u64),
    Float(f32),
    Double(f64),
    Date(u16, u8, u8, u8, u8, u8, u32),
    Time(bool, u32, u8, u8, u8, u32),
}
Expand description

Client side representation of a value of MySql column.

The Value is also used as a parameter to a prepared statement.

Variants§

§

NULL

§

Bytes(Vec<u8>)

§

Int(i64)

§

UInt(u64)

§

Float(f32)

§

Double(f64)

§

Date(u16, u8, u8, u8, u8, u8, u32)

year, month, day, hour, minutes, seconds, micro seconds

§

Time(bool, u32, u8, u8, u8, u32)

is negative, days, hours, minutes, seconds, micro seconds

Implementations§

Source§

impl Value

Source

pub fn bin_len(&self) -> usize

Returns length in binary serialized form.

Source

pub fn as_sql(&self, no_backslash_escape: bool) -> String

Trait Implementations§

Source§

impl Clone for Value

Source§

fn clone(&self) -> Value

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl ConvIr<Value> for Value

Source§

impl Debug for Value

Source§

fn fmt(&self, formatter: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl<'a> From<&'a [u8]> for Value

Source§

fn from(x: &'a [u8]) -> Value

Converts to this type from the input type.
Source§

impl<'a, T> From<&'a T> for Value
where T: ToValue,

Source§

fn from(x: &'a T) -> Value

Converts to this type from the input type.
Source§

impl<'a> From<&'a str> for Value

Source§

fn from(x: &'a str) -> Value

Converts to this type from the input type.
Source§

impl From<[u8; 0]> for Value

Source§

fn from(x: [u8; 0]) -> Value

Converts to this type from the input type.
Source§

impl From<[u8; 1]> for Value

Source§

fn from(x: [u8; 1]) -> Value

Converts to this type from the input type.
Source§

impl From<[u8; 10]> for Value

Source§

fn from(x: [u8; 10]) -> Value

Converts to this type from the input type.
Source§

impl From<[u8; 11]> for Value

Source§

fn from(x: [u8; 11]) -> Value

Converts to this type from the input type.
Source§

impl From<[u8; 12]> for Value

Source§

fn from(x: [u8; 12]) -> Value

Converts to this type from the input type.
Source§

impl From<[u8; 13]> for Value

Source§

fn from(x: [u8; 13]) -> Value

Converts to this type from the input type.
Source§

impl From<[u8; 14]> for Value

Source§

fn from(x: [u8; 14]) -> Value

Converts to this type from the input type.
Source§

impl From<[u8; 15]> for Value

Source§

fn from(x: [u8; 15]) -> Value

Converts to this type from the input type.
Source§

impl From<[u8; 16]> for Value

Source§

fn from(x: [u8; 16]) -> Value

Converts to this type from the input type.
Source§

impl From<[u8; 17]> for Value

Source§

fn from(x: [u8; 17]) -> Value

Converts to this type from the input type.
Source§

impl From<[u8; 18]> for Value

Source§

fn from(x: [u8; 18]) -> Value

Converts to this type from the input type.
Source§

impl From<[u8; 19]> for Value

Source§

fn from(x: [u8; 19]) -> Value

Converts to this type from the input type.
Source§

impl From<[u8; 2]> for Value

Source§

fn from(x: [u8; 2]) -> Value

Converts to this type from the input type.
Source§

impl From<[u8; 20]> for Value

Source§

fn from(x: [u8; 20]) -> Value

Converts to this type from the input type.
Source§

impl From<[u8; 21]> for Value

Source§

fn from(x: [u8; 21]) -> Value

Converts to this type from the input type.
Source§

impl From<[u8; 22]> for Value

Source§

fn from(x: [u8; 22]) -> Value

Converts to this type from the input type.
Source§

impl From<[u8; 23]> for Value

Source§

fn from(x: [u8; 23]) -> Value

Converts to this type from the input type.
Source§

impl From<[u8; 24]> for Value

Source§

fn from(x: [u8; 24]) -> Value

Converts to this type from the input type.
Source§

impl From<[u8; 25]> for Value

Source§

fn from(x: [u8; 25]) -> Value

Converts to this type from the input type.
Source§

impl From<[u8; 26]> for Value

Source§

fn from(x: [u8; 26]) -> Value

Converts to this type from the input type.
Source§

impl From<[u8; 27]> for Value

Source§

fn from(x: [u8; 27]) -> Value

Converts to this type from the input type.
Source§

impl From<[u8; 28]> for Value

Source§

fn from(x: [u8; 28]) -> Value

Converts to this type from the input type.
Source§

impl From<[u8; 29]> for Value

Source§

fn from(x: [u8; 29]) -> Value

Converts to this type from the input type.
Source§

impl From<[u8; 3]> for Value

Source§

fn from(x: [u8; 3]) -> Value

Converts to this type from the input type.
Source§

impl From<[u8; 30]> for Value

Source§

fn from(x: [u8; 30]) -> Value

Converts to this type from the input type.
Source§

impl From<[u8; 31]> for Value

Source§

fn from(x: [u8; 31]) -> Value

Converts to this type from the input type.
Source§

impl From<[u8; 32]> for Value

Source§

fn from(x: [u8; 32]) -> Value

Converts to this type from the input type.
Source§

impl From<[u8; 4]> for Value

Source§

fn from(x: [u8; 4]) -> Value

Converts to this type from the input type.
Source§

impl From<[u8; 5]> for Value

Source§

fn from(x: [u8; 5]) -> Value

Converts to this type from the input type.
Source§

impl From<[u8; 6]> for Value

Source§

fn from(x: [u8; 6]) -> Value

Converts to this type from the input type.
Source§

impl From<[u8; 7]> for Value

Source§

fn from(x: [u8; 7]) -> Value

Converts to this type from the input type.
Source§

impl From<[u8; 8]> for Value

Source§

fn from(x: [u8; 8]) -> Value

Converts to this type from the input type.
Source§

impl From<[u8; 9]> for Value

Source§

fn from(x: [u8; 9]) -> Value

Converts to this type from the input type.
Source§

impl From<BigDecimal> for Value

Source§

fn from(big_decimal: BigDecimal) -> Value

Converts to this type from the input type.
Source§

impl From<BigInt> for Value

Source§

fn from(x: BigInt) -> Value

Converts to this type from the input type.
Source§

impl From<BigUint> for Value

Source§

fn from(x: BigUint) -> Value

Converts to this type from the input type.
Source§

impl From<Date> for Value

Source§

fn from(x: Date) -> Value

Converts to this type from the input type.
Source§

impl From<Decimal> for Value

Source§

fn from(decimal: Decimal) -> Value

Converts to this type from the input type.
Source§

impl From<Duration> for Value

Source§

fn from(x: Duration) -> Value

Converts to this type from the input type.
Source§

impl From<Duration> for Value

Source§

fn from(x: Duration) -> Value

Converts to this type from the input type.
Source§

impl From<NaiveDate> for Value

Source§

fn from(x: NaiveDate) -> Value

Converts to this type from the input type.
Source§

impl From<NaiveDateTime> for Value

Source§

fn from(x: NaiveDateTime) -> Value

Converts to this type from the input type.
Source§

impl From<NaiveTime> for Value

Source§

fn from(x: NaiveTime) -> Value

Converts to this type from the input type.
Source§

impl<T> From<Option<T>> for Value
where T: Into<Value>,

Source§

fn from(x: Option<T>) -> Value

Converts to this type from the input type.
Source§

impl From<PrimitiveDateTime> for Value

Source§

fn from(x: PrimitiveDateTime) -> Value

Converts to this type from the input type.
Source§

impl<T> From<Serialized<T>> for Value
where T: Serialize,

Source§

fn from(x: Serialized<T>) -> Value

Converts to this type from the input type.
Source§

impl From<String> for Value

Source§

fn from(x: String) -> Value

Converts to this type from the input type.
Source§

impl From<Time> for Value

Source§

fn from(x: Time) -> Value

Converts to this type from the input type.
Source§

impl From<Uuid> for Value

Source§

fn from(uuid: Uuid) -> Value

Converts to this type from the input type.
Source§

impl From<Value> for Value

Source§

fn from(x: Value) -> Value

Converts to this type from the input type.
Source§

impl From<Vec<u8>> for Value

Source§

fn from(x: Vec<u8>) -> Value

Converts to this type from the input type.
Source§

impl From<bool> for Value

Source§

fn from(x: bool) -> Value

Converts to this type from the input type.
Source§

impl From<f32> for Value

Source§

fn from(x: f32) -> Value

Converts to this type from the input type.
Source§

impl From<f64> for Value

Source§

fn from(x: f64) -> Value

Converts to this type from the input type.
Source§

impl From<i128> for Value

Source§

fn from(x: i128) -> Value

Converts to this type from the input type.
Source§

impl From<i16> for Value

Source§

fn from(x: i16) -> Value

Converts to this type from the input type.
Source§

impl From<i32> for Value

Source§

fn from(x: i32) -> Value

Converts to this type from the input type.
Source§

impl From<i64> for Value

Source§

fn from(x: i64) -> Value

Converts to this type from the input type.
Source§

impl From<i8> for Value

Source§

fn from(x: i8) -> Value

Converts to this type from the input type.
Source§

impl From<isize> for Value

Source§

fn from(x: isize) -> Value

Converts to this type from the input type.
Source§

impl From<u128> for Value

Source§

fn from(x: u128) -> Value

Converts to this type from the input type.
Source§

impl From<u16> for Value

Source§

fn from(x: u16) -> Value

Converts to this type from the input type.
Source§

impl From<u32> for Value

Source§

fn from(x: u32) -> Value

Converts to this type from the input type.
Source§

impl From<u64> for Value

Source§

fn from(x: u64) -> Value

Converts to this type from the input type.
Source§

impl From<u8> for Value

Source§

fn from(x: u8) -> Value

Converts to this type from the input type.
Source§

impl From<usize> for Value

Source§

fn from(x: usize) -> Value

Converts to this type from the input type.
Source§

impl FromValue for Value

Source§

type Intermediate = Value

Source§

fn from_value(v: Value) -> Value

Will panic if could not convert v to Self.
Source§

fn from_value_opt(v: Value) -> Result<Value, FromValueError>

Will return Err(Error::FromValueError(v)) if could not convert v to Self.
Source§

fn get_intermediate(v: Value) -> Result<Self::Intermediate, FromValueError>

Will return Err(Error::FromValueError(v)) if v is not convertible to Self.
Source§

impl PartialEq for Value

Source§

fn eq(&self, other: &Value) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl PartialOrd for Value

Source§

fn partial_cmp(&self, other: &Value) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · Source§

fn lt(&self, other: &Rhs) -> bool

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · Source§

fn le(&self, other: &Rhs) -> bool

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · Source§

fn gt(&self, other: &Rhs) -> bool

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · Source§

fn ge(&self, other: &Rhs) -> bool

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl StructuralPartialEq for Value

Auto Trait Implementations§

§

impl Freeze for Value

§

impl RefUnwindSafe for Value

§

impl Send for Value

§

impl Sync for Value

§

impl Unpin for Value

§

impl UnwindSafe for Value

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> FromRow for T
where T: FromValue,

Source§

fn from_row_opt(row: Row) -> Result<T, FromRowError>

Source§

fn from_row(row: Row) -> Self
where Self: Sized,

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToValue for T
where T: Into<Value> + Clone,

Source§

fn to_value(&self) -> Value

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V