Skip to main content

OwnedMySQLValue

Enum OwnedMySQLValue 

Source
pub enum OwnedMySQLValue {
    Null,
    Bytes(Vec<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 MySQLValue that owns its bytes, for storing parameters beyond the borrow (for example in a cached prepared statement).

Convert with MySQLValue::into_owned or From. SQL::into_owned() does not do this for you: it owns the chunk list but keeps the parameter type.

Variants§

§

Null

SQL NULL.

§

Bytes(Vec<u8>)

Owned text, binary, decimal, JSON, enum, or set bytes.

§

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

Owned date, datetime, or timestamp payload.

Fields

§year: u16

Four-digit year.

§month: u8

Month in the range 1 through 12.

§day: u8

Day of the month.

§hour: u8

Hour in the range 0 through 23.

§minute: u8

Minute in the range 0 through 59.

§second: u8

Second in the range 0 through 59.

§microseconds: u32

Fractional seconds in microseconds.

§

Time

Owned time or duration payload.

Fields

§negative: bool

Whether the duration is negative.

§days: u32

Whole days in the duration.

§hours: u8

Remaining hours after whole days.

§minutes: u8

Remaining minutes after whole hours.

§seconds: u8

Remaining seconds after whole minutes.

§microseconds: u32

Fractional seconds in microseconds.

Trait Implementations§

Source§

impl Clone for OwnedMySQLValue

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for OwnedMySQLValue

Source§

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

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

impl Default for OwnedMySQLValue

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<'a> From<&'a OwnedMySQLValue> for Cow<'a, OwnedMySQLValue>

Source§

fn from(value: &'a OwnedMySQLValue) -> Self

Converts to this type from the input type.
Source§

impl<'a> From<&'a OwnedMySQLValue> for MySQLValue<'a>

Source§

fn from(value: &'a OwnedMySQLValue) -> Self

Converts to this type from the input type.
Source§

impl From<&Arc<String>> for OwnedMySQLValue

Source§

fn from(value: &Arc<String>) -> Self

Converts to this type from the input type.
Source§

impl From<&Arc<Vec<u8>>> for OwnedMySQLValue

Source§

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

Converts to this type from the input type.
Source§

impl From<&Arc<str>> for OwnedMySQLValue

Source§

fn from(value: &Arc<str>) -> Self

Converts to this type from the input type.
Source§

impl From<&Box<String>> for OwnedMySQLValue

Source§

fn from(value: &Box<String>) -> Self

Converts to this type from the input type.
Source§

impl From<&Box<Vec<u8>>> for OwnedMySQLValue

Source§

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

Converts to this type from the input type.
Source§

impl From<&Box<str>> for OwnedMySQLValue

Source§

fn from(value: &Box<str>) -> Self

Converts to this type from the input type.
Source§

impl From<&Rc<String>> for OwnedMySQLValue

Source§

fn from(value: &Rc<String>) -> Self

Converts to this type from the input type.
Source§

impl From<&Rc<Vec<u8>>> for OwnedMySQLValue

Source§

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

Converts to this type from the input type.
Source§

impl From<&Rc<str>> for OwnedMySQLValue

Source§

fn from(value: &Rc<str>) -> Self

Converts to this type from the input type.
Source§

impl From<&String> for OwnedMySQLValue

Source§

fn from(value: &String) -> Self

Converts to this type from the input type.
Source§

impl<const N: usize> From<&[char; N]> for OwnedMySQLValue

Source§

fn from(value: &[char; N]) -> Self

Converts to this type from the input type.
Source§

impl<const N: usize> From<&[u8; N]> for OwnedMySQLValue

Source§

fn from(value: &[u8; N]) -> Self

Converts to this type from the input type.
Source§

impl From<&[u8]> for OwnedMySQLValue

Source§

fn from(value: &[u8]) -> Self

Converts to this type from the input type.
Source§

impl From<&bool> for OwnedMySQLValue

Source§

fn from(value: &bool) -> Self

Converts to this type from the input type.
Source§

impl From<&f32> for OwnedMySQLValue

Source§

fn from(value: &f32) -> Self

Converts to this type from the input type.
Source§

impl From<&f64> for OwnedMySQLValue

Source§

fn from(value: &f64) -> Self

Converts to this type from the input type.
Source§

impl From<&i8> for OwnedMySQLValue

Source§

fn from(value: &i8) -> Self

Converts to this type from the input type.
Source§

impl From<&i16> for OwnedMySQLValue

Source§

fn from(value: &i16) -> Self

Converts to this type from the input type.
Source§

impl From<&i32> for OwnedMySQLValue

Source§

fn from(value: &i32) -> Self

Converts to this type from the input type.
Source§

impl From<&i64> for OwnedMySQLValue

Source§

fn from(value: &i64) -> Self

Converts to this type from the input type.
Source§

impl From<&isize> for OwnedMySQLValue

Source§

fn from(value: &isize) -> Self

Converts to this type from the input type.
Source§

impl From<&str> for OwnedMySQLValue

Source§

fn from(value: &str) -> Self

Converts to this type from the input type.
Source§

impl From<&u8> for OwnedMySQLValue

Source§

fn from(value: &u8) -> Self

Converts to this type from the input type.
Source§

impl From<&u16> for OwnedMySQLValue

Source§

fn from(value: &u16) -> Self

Converts to this type from the input type.
Source§

impl From<&u32> for OwnedMySQLValue

Source§

fn from(value: &u32) -> Self

Converts to this type from the input type.
Source§

impl From<&u64> for OwnedMySQLValue

Source§

fn from(value: &u64) -> Self

Converts to this type from the input type.
Source§

impl From<&usize> for OwnedMySQLValue

Source§

fn from(value: &usize) -> Self

Converts to this type from the input type.
Source§

impl From<Arc<String>> for OwnedMySQLValue

Source§

fn from(value: Arc<String>) -> Self

Converts to this type from the input type.
Source§

impl From<Arc<Vec<u8>>> for OwnedMySQLValue

Source§

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

Converts to this type from the input type.
Source§

impl From<Arc<str>> for OwnedMySQLValue

Source§

fn from(value: Arc<str>) -> Self

Converts to this type from the input type.
Source§

impl From<Box<String>> for OwnedMySQLValue

Source§

fn from(value: Box<String>) -> Self

Converts to this type from the input type.
Source§

impl From<Box<Vec<u8>>> for OwnedMySQLValue

Source§

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

Converts to this type from the input type.
Source§

impl From<Box<str>> for OwnedMySQLValue

Source§

fn from(value: Box<str>) -> Self

Converts to this type from the input type.
Source§

impl From<Cow<'_, [u8]>> for OwnedMySQLValue

Source§

fn from(value: Cow<'_, [u8]>) -> Self

Converts to this type from the input type.
Source§

impl From<Cow<'_, str>> for OwnedMySQLValue

Source§

fn from(value: Cow<'_, str>) -> Self

Converts to this type from the input type.
Source§

impl<'a> From<MySQLValue<'a>> for OwnedMySQLValue

Source§

fn from(value: MySQLValue<'a>) -> Self

Converts to this type from the input type.
Source§

impl<T> From<Option<T>> for OwnedMySQLValue
where Self: From<T>,

Source§

fn from(value: Option<T>) -> Self

Converts to this type from the input type.
Source§

impl From<OwnedMySQLValue> for SQL<'_, OwnedMySQLValue>

Source§

fn from(value: OwnedMySQLValue) -> Self

Converts to this type from the input type.
Source§

impl From<OwnedMySQLValue> for Cow<'_, OwnedMySQLValue>

Source§

fn from(value: OwnedMySQLValue) -> Self

Converts to this type from the input type.
Source§

impl From<OwnedMySQLValue> for MySQLValue<'_>

Source§

fn from(value: OwnedMySQLValue) -> Self

Converts to this type from the input type.
Source§

impl From<Rc<String>> for OwnedMySQLValue

Source§

fn from(value: Rc<String>) -> Self

Converts to this type from the input type.
Source§

impl From<Rc<Vec<u8>>> for OwnedMySQLValue

Source§

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

Converts to this type from the input type.
Source§

impl From<Rc<str>> for OwnedMySQLValue

Source§

fn from(value: Rc<str>) -> Self

Converts to this type from the input type.
Source§

impl From<String> for OwnedMySQLValue

Source§

fn from(value: String) -> Self

Converts to this type from the input type.
Source§

impl From<Vec<u8>> for OwnedMySQLValue

Source§

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

Converts to this type from the input type.
Source§

impl<const N: usize> From<[char; N]> for OwnedMySQLValue

Source§

fn from(value: [char; N]) -> Self

Converts to this type from the input type.
Source§

impl<const N: usize> From<[u8; N]> for OwnedMySQLValue

Source§

fn from(value: [u8; N]) -> Self

Converts to this type from the input type.
Source§

impl From<bool> for OwnedMySQLValue

Source§

fn from(value: bool) -> Self

Converts to this type from the input type.
Source§

impl From<f32> for OwnedMySQLValue

Source§

fn from(value: f32) -> Self

Converts to this type from the input type.
Source§

impl From<f64> for OwnedMySQLValue

Source§

fn from(value: f64) -> Self

Converts to this type from the input type.
Source§

impl From<i8> for OwnedMySQLValue

Source§

fn from(value: i8) -> Self

Converts to this type from the input type.
Source§

impl From<i16> for OwnedMySQLValue

Source§

fn from(value: i16) -> Self

Converts to this type from the input type.
Source§

impl From<i32> for OwnedMySQLValue

Source§

fn from(value: i32) -> Self

Converts to this type from the input type.
Source§

impl From<i64> for OwnedMySQLValue

Source§

fn from(value: i64) -> Self

Converts to this type from the input type.
Source§

impl From<isize> for OwnedMySQLValue

Source§

fn from(value: isize) -> Self

Converts to this type from the input type.
Source§

impl From<u8> for OwnedMySQLValue

Source§

fn from(value: u8) -> Self

Converts to this type from the input type.
Source§

impl From<u16> for OwnedMySQLValue

Source§

fn from(value: u16) -> Self

Converts to this type from the input type.
Source§

impl From<u32> for OwnedMySQLValue

Source§

fn from(value: u32) -> Self

Converts to this type from the input type.
Source§

impl From<u64> for OwnedMySQLValue

Source§

fn from(value: u64) -> Self

Converts to this type from the input type.
Source§

impl From<usize> for OwnedMySQLValue

Source§

fn from(value: usize) -> Self

Converts to this type from the input type.
Source§

impl PartialEq for OwnedMySQLValue

Source§

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

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

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

Inequality operator !=. Read more
Source§

impl SQLParam for OwnedMySQLValue

Source§

const DIALECT: Dialect = Dialect::MySQL

The dialect, at runtime.
Source§

type DialectMarker = MySQLDialect

The dialect, as a type (SQLiteDialect, PostgresDialect or MySQLDialect). Read more
Source§

fn pagination_param(value: usize) -> Option<Self>

Converts a LIMIT/OFFSET value into a parameter, or returns None to write it as a literal (the default). Read more
Source§

fn write_literal(&self, buf: &mut String) -> bool

Appends this value to buf as a SQL literal of this dialect. Read more
Source§

impl StructuralPartialEq for OwnedMySQLValue

Auto Trait Implementations§

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<Joined, From> JoinKey<From, JoinReverse> for Joined
where From: Joinable<Joined> + ?Sized,

Source§

fn pairs() -> &'static [(&'static str, &'static str)]

(joined_column, from_column) pairs the ON condition matches, in key order, read through Self::pair.
Source§

fn pair(pair: &(&'static str, &'static str)) -> (&'static str, &'static str)

The (joined_column, from_column) names of pair.
Source§

impl<List> ListIncludes<Nil, ()> for List

Source§

impl<Mk> MarkerAggValidFor<()> for Mk

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, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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<T> TypeEq<T> for T