Enum Value

Source
pub enum Value {
Show 15 variants Null, Tiny(i8), Short(i16), Int(i32), Long(i64), UTiny(u8), UShort(u16), UInt(u32), ULong(u64), Float(f32), Double(f64), Bytes(Vec<u8>), Date(u16, u8, u8), Time(bool, u32, u8, u8, u8, u32), Datetime(u16, u8, u8, u8, u8, u8, u32),
}
Expand description

Mysql value.

§Formatting

Values of type Date, Time and DateTime will be put in quotation marks. Values of type Bytes will be converted to hex. If you only want to escape strings, use StringEscape instead.

Variants§

§

Null

§

Tiny(i8)

§

Short(i16)

§

Int(i32)

§

Long(i64)

§

UTiny(u8)

§

UShort(u16)

§

UInt(u32)

§

ULong(u64)

§

Float(f32)

§

Double(f64)

§

Bytes(Vec<u8>)

§

Date(u16, u8, u8)

year, month, day

§

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

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

§

Datetime(u16, u8, u8, u8, u8, u8, u32)

year, month, day, hour, minute, second, micro second

Implementations§

Source§

impl Value

Source

pub fn bin_len(&self) -> u64

Source§

impl Value

Source

pub fn column_type(&self) -> ColumnType

Source

pub fn is_unsigned(&self) -> bool

Source

pub fn take(&mut self) -> Self

Trait Implementations§

Source§

impl Clone for Value

Source§

fn clone(&self) -> Value

Returns a copy 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 Debug for Value

Source§

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

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

impl Display for Value

Source§

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

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

impl From<Hex> for Value

Source§

fn from(value: Hex) -> Self

Converts to this type from the input type.
Source§

impl From<String> for Value

Source§

fn from(value: String) -> Self

Converts to this type from the input type.
Source§

impl From<TimeDelta> for Value

Source§

fn from(value: Duration) -> Self

Converts to this type from the input type.
Source§

impl From<Vec<u8>> for Value

Source§

fn from(value: Vec<u8>) -> Self

Converts to this type from the input type.
Source§

impl From<bool> for Value

Source§

fn from(value: bool) -> Self

Converts to this type from the input type.
Source§

impl From<f32> for Value

Source§

fn from(value: f32) -> Self

Converts to this type from the input type.
Source§

impl From<f64> for Value

Source§

fn from(value: f64) -> Self

Converts to this type from the input type.
Source§

impl From<i16> for Value

Source§

fn from(value: i16) -> Self

Converts to this type from the input type.
Source§

impl From<i32> for Value

Source§

fn from(value: i32) -> Self

Converts to this type from the input type.
Source§

impl From<i64> for Value

Source§

fn from(value: i64) -> Self

Converts to this type from the input type.
Source§

impl From<i8> for Value

Source§

fn from(value: i8) -> Self

Converts to this type from the input type.
Source§

impl From<u16> for Value

Source§

fn from(value: u16) -> Self

Converts to this type from the input type.
Source§

impl From<u32> for Value

Source§

fn from(value: u32) -> Self

Converts to this type from the input type.
Source§

impl From<u64> for Value

Source§

fn from(value: u64) -> Self

Converts to this type from the input type.
Source§

impl From<u8> for Value

Source§

fn from(value: u8) -> Self

Converts to this type from the input type.
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 SimpleValue for &Value

Source§

fn value(&self) -> &Value

Source§

impl SimpleValue for Value

Source§

fn value(&self) -> &Value

Source§

impl TryFrom<NaiveDate> for Value

Source§

type Error = SerializeError

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

fn try_from(value: NaiveDate) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<NaiveDateTime> for Value

Source§

type Error = SerializeError

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

fn try_from(value: NaiveDateTime) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl<T> TryFrom<Option<T>> for Value
where T: TryInto<Value>,

Source§

type Error = <T as TryInto<Value>>::Error

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

fn try_from(value: Option<T>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryInto<Hex> for Value

Source§

type Error = ParseError

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

fn try_into(self) -> Result<Hex, Self::Error>

Performs the conversion.
Source§

impl TryInto<NaiveDate> for Value

Source§

type Error = ParseError

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

fn try_into(self) -> Result<NaiveDate, Self::Error>

Performs the conversion.
Source§

impl TryInto<NaiveDateTime> for Value

Source§

type Error = ParseError

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

fn try_into(self) -> Result<NaiveDateTime, Self::Error>

Performs the conversion.
Source§

impl TryInto<Option<Hex>> for Value

Source§

type Error = ParseError

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

fn try_into(self) -> Result<Option<Hex>, Self::Error>

Performs the conversion.
Source§

impl TryInto<Option<NaiveDate>> for Value

Source§

type Error = ParseError

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

fn try_into(self) -> Result<Option<NaiveDate>, Self::Error>

Performs the conversion.
Source§

impl TryInto<Option<NaiveDateTime>> for Value

Source§

type Error = ParseError

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

fn try_into(self) -> Result<Option<NaiveDateTime>, Self::Error>

Performs the conversion.
Source§

impl TryInto<Option<String>> for Value

Source§

type Error = ParseError

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

fn try_into(self) -> Result<Option<String>, Self::Error>

Performs the conversion.
Source§

impl TryInto<Option<TimeDelta>> for Value

Source§

type Error = ParseError

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

fn try_into(self) -> Result<Option<Duration>, Self::Error>

Performs the conversion.
Source§

impl TryInto<Option<Vec<u8>>> for Value

Source§

type Error = ParseError

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

fn try_into(self) -> Result<Option<Vec<u8>>, Self::Error>

Performs the conversion.
Source§

impl TryInto<Option<bool>> for Value

Source§

type Error = ParseError

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

fn try_into(self) -> Result<Option<bool>, Self::Error>

Performs the conversion.
Source§

impl TryInto<Option<f32>> for Value

Source§

type Error = ParseError

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

fn try_into(self) -> Result<Option<f32>, Self::Error>

Performs the conversion.
Source§

impl TryInto<Option<f64>> for Value

Source§

type Error = ParseError

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

fn try_into(self) -> Result<Option<f64>, Self::Error>

Performs the conversion.
Source§

impl TryInto<Option<i16>> for Value

Source§

type Error = ParseError

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

fn try_into(self) -> Result<Option<i16>, Self::Error>

Performs the conversion.
Source§

impl TryInto<Option<i32>> for Value

Source§

type Error = ParseError

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

fn try_into(self) -> Result<Option<i32>, Self::Error>

Performs the conversion.
Source§

impl TryInto<Option<i64>> for Value

Source§

type Error = ParseError

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

fn try_into(self) -> Result<Option<i64>, Self::Error>

Performs the conversion.
Source§

impl TryInto<Option<i8>> for Value

Source§

type Error = ParseError

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

fn try_into(self) -> Result<Option<i8>, Self::Error>

Performs the conversion.
Source§

impl TryInto<Option<u16>> for Value

Source§

type Error = ParseError

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

fn try_into(self) -> Result<Option<u16>, Self::Error>

Performs the conversion.
Source§

impl TryInto<Option<u32>> for Value

Source§

type Error = ParseError

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

fn try_into(self) -> Result<Option<u32>, Self::Error>

Performs the conversion.
Source§

impl TryInto<Option<u64>> for Value

Source§

type Error = ParseError

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

fn try_into(self) -> Result<Option<u64>, Self::Error>

Performs the conversion.
Source§

impl TryInto<Option<u8>> for Value

Source§

type Error = ParseError

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

fn try_into(self) -> Result<Option<u8>, Self::Error>

Performs the conversion.
Source§

impl TryInto<String> for Value

Source§

type Error = ParseError

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

fn try_into(self) -> Result<String, Self::Error>

Performs the conversion.
Source§

impl TryInto<TimeDelta> for Value

Source§

type Error = ParseError

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

fn try_into(self) -> Result<Duration, Self::Error>

Performs the conversion.
Source§

impl TryInto<Vec<u8>> for Value

Source§

type Error = ParseError

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

fn try_into(self) -> Result<Vec<u8>, Self::Error>

Performs the conversion.
Source§

impl TryInto<bool> for Value

Source§

type Error = ParseError

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

fn try_into(self) -> Result<bool, Self::Error>

Performs the conversion.
Source§

impl TryInto<f32> for Value

Source§

type Error = ParseError

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

fn try_into(self) -> Result<f32, Self::Error>

Performs the conversion.
Source§

impl TryInto<f64> for Value

Source§

type Error = ParseError

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

fn try_into(self) -> Result<f64, Self::Error>

Performs the conversion.
Source§

impl TryInto<i16> for Value

Source§

type Error = ParseError

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

fn try_into(self) -> Result<i16, Self::Error>

Performs the conversion.
Source§

impl TryInto<i32> for Value

Source§

type Error = ParseError

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

fn try_into(self) -> Result<i32, Self::Error>

Performs the conversion.
Source§

impl TryInto<i64> for Value

Source§

type Error = ParseError

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

fn try_into(self) -> Result<i64, Self::Error>

Performs the conversion.
Source§

impl TryInto<i8> for Value

Source§

type Error = ParseError

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

fn try_into(self) -> Result<i8, Self::Error>

Performs the conversion.
Source§

impl TryInto<u16> for Value

Source§

type Error = ParseError

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

fn try_into(self) -> Result<u16, Self::Error>

Performs the conversion.
Source§

impl TryInto<u32> for Value

Source§

type Error = ParseError

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

fn try_into(self) -> Result<u32, Self::Error>

Performs the conversion.
Source§

impl TryInto<u64> for Value

Source§

type Error = ParseError

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

fn try_into(self) -> Result<u64, Self::Error>

Performs the conversion.
Source§

impl TryInto<u8> for Value

Source§

type Error = ParseError

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

fn try_into(self) -> Result<u8, Self::Error>

Performs the conversion.
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, 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> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
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> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
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