[][src]Enum quaint::ast::ParameterizedValue

pub enum ParameterizedValue<'a> {
    Null,
    Integer(i64),
    Real(Decimal),
    Text(Cow<'a, str>),
    Boolean(bool),
    Char(char),
    Array(Vec<ParameterizedValue<'a>>),
    Json(Value),
    Uuid(Uuid),
    DateTime(DateTime<Utc>),
}

A value we must parameterize for the prepared statement.

Variants

Null
Integer(i64)
Real(Decimal)
Text(Cow<'a, str>)
Boolean(bool)
Char(char)
Json(Value)
Uuid(Uuid)
DateTime(DateTime<Utc>)

Methods

impl<'a> ParameterizedValue<'a>[src]

pub fn is_null(&self) -> bool[src]

true if the ParameterizedValue is null.

pub fn is_text(&self) -> bool[src]

true if the ParameterizedValue is text.

pub fn as_str(&self) -> Option<&str>[src]

Returns a &str if the value is text, otherwise None.

pub fn as_char(&self) -> Option<char>[src]

Returns a char if the value is a char, otherwise None.

pub fn to_string(&self) -> Option<String>[src]

Returns a cloned String if the value is text, otherwise None.

pub fn into_string(self) -> Option<String>[src]

Transforms the ParameterizedValue to a String if it's text, otherwise None.

pub fn is_integer(&self) -> bool[src]

true if the ParameterizedValue is an integer.

pub fn as_i64(&self) -> Option<i64>[src]

Returns an i64 if the value is an integer, otherwise None.

pub fn is_real(&self) -> bool[src]

true if the ParameterizedValue is a real value.

pub fn as_f64(&self) -> Option<f64>[src]

Returns a f64 if the value is a real value and the underlying decimal can be converted, otherwise None.

pub fn as_decimal(&self) -> Option<Decimal>[src]

Returns a decimal if the value is a real value, otherwise None.

pub fn is_bool(&self) -> bool[src]

true if the ParameterizedValue is a boolean value.

pub fn as_bool(&self) -> Option<bool>[src]

Returns a bool if the value is a boolean, otherwise None.

pub fn is_uuid(&self) -> bool[src]

true if the ParameterizedValue is of UUID type.

pub fn as_uuid(&self) -> Option<Uuid>[src]

Returns an UUID if the value is of UUID type, otherwise None.

pub fn is_datetime(&self) -> bool[src]

true if the ParameterizedValue is a DateTime.

pub fn as_datetime(&self) -> Option<DateTime<Utc>>[src]

Returns a DateTime if the value is a DateTime, otherwise None.

pub fn is_json(&self) -> bool[src]

true if the ParameterizedValue is a JSON value.

pub fn as_json(&self) -> Option<&Value>[src]

Returns a reference to a JSON Value if of Json type, otherwise None.

pub fn into_json(self) -> Option<Value>[src]

Transforms to a JSON Value if of Json type, otherwise None.

pub fn into_vec<T>(self) -> Option<Vec<T>> where
    T: TryFrom<ParameterizedValue<'a>>, 
[src]

Returns a Vec if the value is an array of T, otherwise None.

Trait Implementations

impl<'a> Clone for ParameterizedValue<'a>[src]

impl<'a> Debug for ParameterizedValue<'a>[src]

impl<'a> Display for ParameterizedValue<'a>[src]

impl<'a> From<&'a str> for ParameterizedValue<'a>[src]

impl<'a> From<DateTime<Utc>> for ParameterizedValue<'a>[src]

impl<'a> From<Decimal> for ParameterizedValue<'a>[src]

impl<'a> From<ParameterizedValue<'a>> for Value[src]

impl<'a> From<ParameterizedValue<'a>> for MyValue[src]

impl<'a> From<String> for ParameterizedValue<'a>[src]

impl<'a> From<Uuid> for ParameterizedValue<'a>[src]

impl<'a> From<Value> for ParameterizedValue<'a>[src]

impl<'a> From<bool> for ParameterizedValue<'a>[src]

impl<'a> From<f32> for ParameterizedValue<'a>[src]

impl<'a> From<f64> for ParameterizedValue<'a>[src]

impl<'a> From<i32> for ParameterizedValue<'a>[src]

impl<'a> From<i64> for ParameterizedValue<'a>[src]

impl<'a> From<usize> for ParameterizedValue<'a>[src]

impl<'a> PartialEq<ParameterizedValue<'a>> for ParameterizedValue<'a>[src]

impl<'a> StructuralPartialEq for ParameterizedValue<'a>[src]

impl<'a> ToSql for ParameterizedValue<'a>[src]

impl<'a> ToSql for ParameterizedValue<'a>[src]

impl<'a> TryFrom<ParameterizedValue<'a>> for i64[src]

type Error = Error

The type returned in the event of a conversion error.

impl<'a> TryFrom<ParameterizedValue<'a>> for Decimal[src]

type Error = Error

The type returned in the event of a conversion error.

impl<'a> TryFrom<ParameterizedValue<'a>> for f64[src]

type Error = Error

The type returned in the event of a conversion error.

impl<'a> TryFrom<ParameterizedValue<'a>> for String[src]

type Error = Error

The type returned in the event of a conversion error.

impl<'a> TryFrom<ParameterizedValue<'a>> for bool[src]

type Error = Error

The type returned in the event of a conversion error.

impl<'a> TryFrom<ParameterizedValue<'a>> for DateTime<Utc>[src]

type Error = Error

The type returned in the event of a conversion error.

impl ValueIndex<ResultRow, ParameterizedValue<'static>> for usize[src]

impl<'_> ValueIndex<ResultRow, ParameterizedValue<'static>> for &'_ str[src]

impl<'_> ValueIndex<ResultRowRef<'_>, ParameterizedValue<'static>> for usize[src]

impl<'_, '_> ValueIndex<ResultRowRef<'_>, ParameterizedValue<'static>> for &'_ str[src]

Auto Trait Implementations

impl<'a> RefUnwindSafe for ParameterizedValue<'a>

impl<'a> Send for ParameterizedValue<'a>

impl<'a> Sync for ParameterizedValue<'a>

impl<'a> Unpin for ParameterizedValue<'a>

impl<'a> UnwindSafe for ParameterizedValue<'a>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

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

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

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