Serialized

Struct Serialized 

Source
pub struct Serialized<T: Serialize + DeserializeOwned + Clone> { /* private fields */ }
Expand description

Stores an arbitrary Rust data type as serialized JSON in a string field.

Implementations§

Source§

impl<T: Serialize + DeserializeOwned + Clone> Serialized<T>

Source

pub fn wrapped(self) -> T

Returns the object stored inside this representational wrapper.

Trait Implementations§

Source§

impl<T: Serialize + DeserializeOwned + Clone> AsMut<T> for Serialized<T>

Source§

fn as_mut(&mut self) -> &mut T

Converts this type into a mutable reference of the (usually inferred) input type.
Source§

impl<T: Serialize + DeserializeOwned + Clone> AsRef<T> for Serialized<T>

Source§

fn as_ref(&self) -> &T

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl<T: Clone + Serialize + DeserializeOwned + Clone> Clone for Serialized<T>

Source§

fn clone(&self) -> Serialized<T>

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<T: 'static + Serialize + DeserializeOwned + Debug + Clone> Datum for Serialized<T>

Source§

fn sql_type() -> &'static str

The type used in a SQL database to represent this datum.
Source§

fn bind_to(&self, stmt: &mut StatementContext<'_>, index: i32)

Bind this datum to a StatementContext at a given index.
Source§

fn build_from( rdata: RelationData, stmt: &mut StatementRow<'_>, index: &mut i32, ) -> DBResult<Self>
where Self: Sized,

Construct an instance of this datum from a table row.
Source§

fn accept_discriminator(d: &mut impl DatumDiscriminator)
where Self: Sized,

Accept a datum discriminator without any instance reference to allow for more fine-grained per-type processing.
Source§

fn accept_discriminator_ref(&self, d: &mut impl DatumDiscriminatorRef)
where Self: Sized,

Accept a datum discriminator with an instance reference to allow for more fine-grained per-type processing.
Source§

fn debug_field(&self, field: &'static str, fmt: &mut DebugStruct<'_, '_>)
where Self: Sized,

Generate a std::fmt::Debug-compatible view of the current datum; used to produce more human-friendly outputs for some more complicated types with state stored in the database.
Source§

fn accept_entity_visitor(_: &mut impl EntityVisitor)

Accept an entity visitor to iterate across any entities this Datum type references.
Source§

impl<T: Serialize + DeserializeOwned + Debug + Clone> Debug for Serialized<T>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<T: Serialize + DeserializeOwned + Default + Clone> Default for Serialized<T>

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<T: Serialize + DeserializeOwned + Clone> DerefMut for Serialized<T>

Source§

fn deref_mut(&mut self) -> &mut Self::Target

Mutably dereferences the value.
Source§

impl<T: Serialize + DeserializeOwned + Clone> From<T> for Serialized<T>

Source§

fn from(value: T) -> Self

Converts to this type from the input type.
Source§

impl<T: Serialize + DeserializeOwned + Clone> Deref for Serialized<T>

Source§

type Target = T

The resulting type after dereferencing.
Source§

fn deref(&self) -> &Self::Target

Dereferences the value.
Source§

impl<T: 'static + Serialize + DeserializeOwned + Debug + Clone> ConcreteDatum for Serialized<T>

Source§

impl<T: 'static + DatumProxy + Datum + Serializable> QueryEquivalent<Serialized<T>> for T

Auto Trait Implementations§

§

impl<T> Freeze for Serialized<T>
where T: Freeze,

§

impl<T> RefUnwindSafe for Serialized<T>
where T: RefUnwindSafe,

§

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

§

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

§

impl<T> Unpin for Serialized<T>
where T: Unpin,

§

impl<T> UnwindSafe for Serialized<T>
where T: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> ConcreteDatumList for T
where T: ConcreteDatum,

Source§

fn build_equivalent<'l>( from: impl Iterator<Item = &'l str>, ) -> Option<impl QueryEquivalentList<T> + 'l>

Construct a DatumList that is query-equivalent of the current type. See QueryEquivalent and QueryEquivalentList for more information.
Source§

impl<T> DatumList for T
where T: Datum,

Source§

type ListHead = T

The first Datum in this list, or a sentinel for an empty list.
Source§

type ListTail = ()

Another DatumList containing all but the first datums in this list.
Source§

type RefList<'l> = () where T: 'l

A version of this DatumList where each element is replaced by a reference to this DatumList, ie turning &(T1, T2) into (&T1, &T2).
Source§

fn list_head(&self) -> &<T as DatumList>::ListHead

Get an instance of the first element of this list.
Source§

fn list_tail(&self) -> <T as DatumList>::ListTail

Create a copy of the tail of this list.
Source§

fn accept(&self, visitor: &mut impl DatumVisitor)

Accept a datum visitor for iteration.
Source§

const IS_EMPTY: bool = false

Recursion control: true if this is an empty list.
Source§

fn create_ref(&self) -> Self::RefList<'_>

Create a referenced version of the current list; see Self::RefList.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<P, T> Receiver for P
where P: Deref<Target = T> + ?Sized, T: ?Sized,

Source§

type Target = T

🔬This is a nightly-only experimental API. (arbitrary_self_types)
The target type on which the method may be called.
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> QueryEquivalent<T> for T
where T: ConcreteDatum,

Source§

impl<T, E> QueryEquivalentList<T> for E