[−][src]Enum quaint::ast::ParameterizedValue
A value we must parameterize for the prepared statement.
Variants
Integer(i64)
Real(Decimal)
Boolean(bool)
Char(char)
Array(Vec<ParameterizedValue<'a>>)
Json(Value)
Uuid(Uuid)
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]
T: TryFrom<ParameterizedValue<'a>>,
Returns a VecNone
.
Trait Implementations
impl<'a> Clone for ParameterizedValue<'a>
[src]
fn clone(&self) -> ParameterizedValue<'a>
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[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]
fn from(pv: ParameterizedValue<'a>) -> Self
[src]
impl<'a> From<ParameterizedValue<'a>> for MyValue
[src]
fn from(pv: ParameterizedValue<'a>) -> 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]
fn eq(&self, other: &ParameterizedValue<'a>) -> bool
[src]
fn ne(&self, other: &ParameterizedValue<'a>) -> bool
[src]
impl<'a> StructuralPartialEq for ParameterizedValue<'a>
[src]
impl<'a> ToSql for ParameterizedValue<'a>
[src]
fn to_sql(
&self,
ty: &PostgresType,
out: &mut BytesMut
) -> Result<IsNull, Box<dyn Error + Send + Sync + 'static>>
[src]
&self,
ty: &PostgresType,
out: &mut BytesMut
) -> Result<IsNull, Box<dyn Error + Send + Sync + 'static>>
fn accepts(_: &PostgresType) -> bool
[src]
fn to_sql_checked(
&self,
ty: &PostgresType,
out: &mut BytesMut
) -> Result<IsNull, Box<dyn Error + Send + Sync + 'static>>
[src]
&self,
ty: &PostgresType,
out: &mut BytesMut
) -> Result<IsNull, Box<dyn Error + Send + Sync + 'static>>
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.
fn try_from(value: ParameterizedValue<'a>) -> Result<i64, Self::Error>
[src]
impl<'a> TryFrom<ParameterizedValue<'a>> for Decimal
[src]
type Error = Error
The type returned in the event of a conversion error.
fn try_from(value: ParameterizedValue<'a>) -> Result<Decimal, Self::Error>
[src]
impl<'a> TryFrom<ParameterizedValue<'a>> for f64
[src]
type Error = Error
The type returned in the event of a conversion error.
fn try_from(value: ParameterizedValue<'a>) -> Result<f64, Self::Error>
[src]
impl<'a> TryFrom<ParameterizedValue<'a>> for String
[src]
type Error = Error
The type returned in the event of a conversion error.
fn try_from(value: ParameterizedValue<'a>) -> Result<String, Self::Error>
[src]
impl<'a> TryFrom<ParameterizedValue<'a>> for bool
[src]
type Error = Error
The type returned in the event of a conversion error.
fn try_from(value: ParameterizedValue<'a>) -> Result<bool, Self::Error>
[src]
impl<'a> TryFrom<ParameterizedValue<'a>> for DateTime<Utc>
[src]
type Error = Error
The type returned in the event of a conversion error.
fn try_from(value: ParameterizedValue<'a>) -> Result<DateTime<Utc>, Self::Error>
[src]
impl ValueIndex<ResultRow, ParameterizedValue<'static>> for usize
[src]
fn index_into<'v>(self, row: &'v ResultRow) -> &'v ParameterizedValue<'static>
[src]
impl<'_> ValueIndex<ResultRow, ParameterizedValue<'static>> for &'_ str
[src]
fn index_into<'v>(self, row: &'v ResultRow) -> &'v ParameterizedValue<'static>
[src]
impl<'_> ValueIndex<ResultRowRef<'_>, ParameterizedValue<'static>> for usize
[src]
fn index_into<'v>(
self,
row: &'v ResultRowRef
) -> &'v ParameterizedValue<'static>
[src]
self,
row: &'v ResultRowRef
) -> &'v ParameterizedValue<'static>
impl<'_, '_> ValueIndex<ResultRowRef<'_>, ParameterizedValue<'static>> for &'_ str
[src]
fn index_into<'v>(
self,
row: &'v ResultRowRef
) -> &'v ParameterizedValue<'static>
[src]
self,
row: &'v ResultRowRef
) -> &'v ParameterizedValue<'static>
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]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T> ToValue for T where
T: Clone + Into<Value>,
T: Clone + Into<Value>,
fn to_value(&self) -> Value
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,