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> Debug for Deserialized<T>where
T: Debug,
impl<T> Debug for Deserialized<T>where
T: Debug,
Source§impl<'de, T> Deserialize<'de> for Deserialized<T>where
T: Deserialize<'de>,
impl<'de, T> Deserialize<'de> for Deserialized<T>where
T: Deserialize<'de>,
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<Deserialized<T>, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<Deserialized<T>, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl<T> From<ParseIr<Deserialized<T>>> for Deserialized<T>where
T: DeserializeOwned,
impl<T> From<ParseIr<Deserialized<T>>> for Deserialized<T>where
T: DeserializeOwned,
Source§fn from(value: ParseIr<Deserialized<T>>) -> Deserialized<T>
fn from(value: ParseIr<Deserialized<T>>) -> Deserialized<T>
Converts to this type from the input type.
Source§impl<T> FromValue for Deserialized<T>where
T: DeserializeOwned,
impl<T> FromValue for Deserialized<T>where
T: DeserializeOwned,
type Intermediate = ParseIr<Deserialized<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 for Deserialized<T>where
T: PartialEq,
impl<T> PartialEq for Deserialized<T>where
T: PartialEq,
Source§impl<T> PartialOrd for Deserialized<T>where
T: PartialOrd,
impl<T> PartialOrd for Deserialized<T>where
T: PartialOrd,
impl<T> Copy for Deserialized<T>where
T: Copy,
impl<T> Eq for Deserialized<T>where
T: Eq,
impl<T> StructuralPartialEq for Deserialized<T>
Auto Trait Implementations§
impl<T> Freeze for Deserialized<T>where
T: Freeze,
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§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.