Struct mysql_async::Serialized [] [src]

pub struct Serialized<T>(pub T);

Use it to pass T: Serialize as JSON to a prepared statement.

This example is not tested
#[derive(Serialize)]
struct SerializableStruct {
    // ...
}

conn.prep_exec("INSERT INTO table (json_column) VALUES (?)",
               (Serialized(SerializableStruct),));

Trait Implementations

impl<T> PartialOrd<Serialized<T>> for Serialized<T> where
    T: PartialOrd<T>, 
[src]

[src]

This method returns an ordering between self and other values if one exists. Read more

[src]

This method tests less than (for self and other) and is used by the < operator. Read more

[src]

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

[src]

This method tests greater than (for self and other) and is used by the > operator. Read more

[src]

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

impl<T> Copy for Serialized<T> where
    T: Copy
[src]

impl<T> PartialEq<Serialized<T>> for Serialized<T> where
    T: PartialEq<T>, 
[src]

[src]

This method tests for self and other values to be equal, and is used by ==. Read more

[src]

This method tests for !=.

impl<T> Clone for Serialized<T> where
    T: Clone
[src]

[src]

Returns a copy of the value. Read more

1.0.0
[src]

Performs copy-assignment from source. Read more

impl<T> Ord for Serialized<T> where
    T: Ord
[src]

[src]

This method returns an Ordering between self and other. Read more

1.21.0
[src]

Compares and returns the maximum of two values. Read more

1.21.0
[src]

Compares and returns the minimum of two values. Read more

impl<T> Eq for Serialized<T> where
    T: Eq
[src]

impl<T> Hash for Serialized<T> where
    T: Hash
[src]

[src]

Feeds this value into the given [Hasher]. Read more

1.3.0
[src]

Feeds a slice of this type into the given [Hasher]. Read more

impl<T> From<Serialized<T>> for Value where
    T: Serialize
[src]

[src]

Performs the conversion.

impl<T> Debug for Serialized<T> where
    T: Debug
[src]

[src]

Formats the value using the given formatter. Read more

Auto Trait Implementations

impl<T> Send for Serialized<T> where
    T: Send

impl<T> Sync for Serialized<T> where
    T: Sync