Struct mysql::Serialized
source · pub struct Serialized<T>(pub T);
Expand description
Use it to pass T: Serialize
as JSON to a prepared statement.
ⓘ
#[derive(Serialize)]
struct SerializableStruct {
// ...
}
conn.prep_exec("INSERT INTO table (json_column) VALUES (?)",
(Serialized(SerializableStruct),));
Tuple Fields§
§0: T
Trait Implementations§
source§impl<T> Clone for Serialized<T>where
T: Clone,
impl<T> Clone for Serialized<T>where
T: Clone,
source§fn clone(&self) -> Serialized<T>
fn clone(&self) -> Serialized<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 Serialized<T>where
T: Debug,
impl<T> Debug for Serialized<T>where
T: Debug,
source§impl<T> From<Serialized<T>> for Valuewhere
T: Serialize,
impl<T> From<Serialized<T>> for Valuewhere
T: Serialize,
source§fn from(x: Serialized<T>) -> Value
fn from(x: Serialized<T>) -> Value
Converts to this type from the input type.
source§impl<T> Hash for Serialized<T>where
T: Hash,
impl<T> Hash for Serialized<T>where
T: Hash,
source§impl<T> Ord for Serialized<T>where
T: Ord,
impl<T> Ord for Serialized<T>where
T: Ord,
source§fn cmp(&self, other: &Serialized<T>) -> Ordering
fn cmp(&self, other: &Serialized<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<Serialized<T>> for Serialized<T>where
T: PartialEq<T>,
impl<T> PartialEq<Serialized<T>> for Serialized<T>where
T: PartialEq<T>,
source§fn eq(&self, other: &Serialized<T>) -> bool
fn eq(&self, other: &Serialized<T>) -> bool
source§impl<T> PartialOrd<Serialized<T>> for Serialized<T>where
T: PartialOrd<T>,
impl<T> PartialOrd<Serialized<T>> for Serialized<T>where
T: PartialOrd<T>,
source§fn partial_cmp(&self, other: &Serialized<T>) -> Option<Ordering>
fn partial_cmp(&self, other: &Serialized<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