Struct mysql::Deserialized
source · pub struct Deserialized<T>(pub T);
Expand description
Use it to parse T: Deserialize
from Value
.
ⓘ
#[derive(Deserialize)]
struct DeserializableStruct {
// ...
}
// ...
let (Deserialized(val),): (Deserialized<DeserializableStruct>,)
= from_row(row_with_single_json_column);
Tuple Fields§
§0: T
Trait Implementations§
source§impl<T> Clone for Deserialized<T>where
T: Clone,
impl<T> Clone for Deserialized<T>where
T: Clone,
source§fn clone(&self) -> Deserialized<T>
fn clone(&self) -> Deserialized<T>
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl<T> ConvIr<Deserialized<T>> for DeserializedIr<T>where
T: DeserializeOwned,
impl<T> ConvIr<Deserialized<T>> for DeserializedIr<T>where
T: DeserializeOwned,
fn new(v: Value) -> Result<DeserializedIr<T>, FromValueError>
fn commit(self) -> Deserialized<T>
fn rollback(self) -> Value
source§impl<T> Debug for Deserialized<T>where
T: Debug,
impl<T> Debug for Deserialized<T>where
T: Debug,
source§impl<T> FromValue for Deserialized<T>where
T: DeserializeOwned,
impl<T> FromValue for Deserialized<T>where
T: DeserializeOwned,
type Intermediate = DeserializedIr<T>
source§fn from_value(v: Value) -> Self
fn from_value(v: Value) -> Self
Will panic if could not convert
v
to Self
.source§fn from_value_opt(v: Value) -> Result<Self, FromValueError>
fn from_value_opt(v: Value) -> Result<Self, FromValueError>
Will return
Err(Error::FromValueError(v))
if could not convert v
to Self
.source§fn get_intermediate(v: Value) -> Result<Self::Intermediate, FromValueError>
fn get_intermediate(v: Value) -> Result<Self::Intermediate, FromValueError>
Will return
Err(Error::FromValueError(v))
if v
is not convertible to Self
.source§impl<T> Hash for Deserialized<T>where
T: Hash,
impl<T> Hash for Deserialized<T>where
T: Hash,
source§impl<T> Ord for Deserialized<T>where
T: Ord,
impl<T> Ord for Deserialized<T>where
T: Ord,
source§fn cmp(&self, other: &Deserialized<T>) -> Ordering
fn cmp(&self, other: &Deserialized<T>) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
source§impl<T> PartialEq<Deserialized<T>> for Deserialized<T>where
T: PartialEq<T>,
impl<T> PartialEq<Deserialized<T>> for Deserialized<T>where
T: PartialEq<T>,
source§fn eq(&self, other: &Deserialized<T>) -> bool
fn eq(&self, other: &Deserialized<T>) -> bool
source§impl<T> PartialOrd<Deserialized<T>> for Deserialized<T>where
T: PartialOrd<T>,
impl<T> PartialOrd<Deserialized<T>> for Deserialized<T>where
T: PartialOrd<T>,
source§fn partial_cmp(&self, other: &Deserialized<T>) -> Option<Ordering>
fn partial_cmp(&self, other: &Deserialized<T>) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read more