Struct mysql_common::value::json::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
sourceimpl<T: Clone> Clone for Deserialized<T>
impl<T: Clone> Clone for Deserialized<T>
sourcefn clone(&self) -> Deserialized<T>
fn clone(&self) -> Deserialized<T>
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresourceimpl<T: DeserializeOwned> ConvIr<Deserialized<T>> for DeserializedIr<T>
impl<T: DeserializeOwned> ConvIr<Deserialized<T>> for DeserializedIr<T>
fn new(v: Value) -> Result<DeserializedIr<T>, FromValueError>
fn commit(self) -> Deserialized<T>
fn rollback(self) -> Value
sourceimpl<T: Debug> Debug for Deserialized<T>
impl<T: Debug> Debug for Deserialized<T>
sourceimpl<T: DeserializeOwned> FromValue for Deserialized<T>
impl<T: DeserializeOwned> FromValue for Deserialized<T>
type Intermediate = DeserializedIr<T>
sourcefn from_value(v: Value) -> Self
fn from_value(v: Value) -> Self
Will panic if could not convert
v
to Self
.sourcefn 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
.sourcefn 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
.sourceimpl<T: Hash> Hash for Deserialized<T>
impl<T: Hash> Hash for Deserialized<T>
sourceimpl<T: Ord> Ord for Deserialized<T>
impl<T: Ord> Ord for Deserialized<T>
sourcefn cmp(&self, other: &Deserialized<T>) -> Ordering
fn cmp(&self, other: &Deserialized<T>) -> Ordering
1.21.0 · sourcefn 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
1.21.0 · sourcefn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the minimum of two values. Read more
1.50.0 · sourcefn clamp(self, min: Self, max: Self) -> Selfwhere
Self: Sized + PartialOrd<Self>,
fn clamp(self, min: Self, max: Self) -> Selfwhere
Self: Sized + PartialOrd<Self>,
Restrict a value to a certain interval. Read more
sourceimpl<T: PartialEq> PartialEq<Deserialized<T>> for Deserialized<T>
impl<T: PartialEq> PartialEq<Deserialized<T>> for Deserialized<T>
sourcefn eq(&self, other: &Deserialized<T>) -> bool
fn eq(&self, other: &Deserialized<T>) -> bool
sourceimpl<T: PartialOrd> PartialOrd<Deserialized<T>> for Deserialized<T>
impl<T: PartialOrd> PartialOrd<Deserialized<T>> for Deserialized<T>
sourcefn partial_cmp(&self, other: &Deserialized<T>) -> Option<Ordering>
fn partial_cmp(&self, other: &Deserialized<T>) -> Option<Ordering>
1.0.0 · sourcefn 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 moreimpl<T: Copy> Copy for Deserialized<T>
impl<T: Eq> Eq for Deserialized<T>
impl<T> StructuralEq for Deserialized<T>
impl<T> StructuralPartialEq for Deserialized<T>
Auto Trait Implementations
impl<T> RefUnwindSafe for Deserialized<T>where
T: RefUnwindSafe,
impl<T> Send for Deserialized<T>where
T: Send,
impl<T> Sync for Deserialized<T>where
T: Sync,
impl<T> Unpin for Deserialized<T>where
T: Unpin,
impl<T> UnwindSafe for Deserialized<T>where
T: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more