pub struct Direct<Owned, Borrowed = <Owned as Deref>::Target>
where Borrowed: ToSql + Debug + ?Sized + ToOwned<Owned = Owned>, Owned: FromSql + Borrow<Borrowed> + Debug,
{ /* private fields */ }
Expand description

A Direct serializer, just serializing and deserializing types directly.

Trait Implementations§

source§

impl<Owned, Borrowed> Debug for Direct<Owned, Borrowed>
where Borrowed: ToSql + Debug + ?Sized + ToOwned<Owned = Owned> + Debug, Owned: FromSql + Borrow<Borrowed> + Debug + Debug,

source§

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

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

impl<Owned, Borrowed> Serializer for Direct<Owned, Borrowed>
where Borrowed: ToSql + Debug + ?Sized + ToOwned<Owned = Owned>, Owned: FromSql + Borrow<Borrowed> + Debug,

§

type Target = Owned

An owned target, for deserialization. This is exposed to the user in objects returned to them from queries.
§

type TargetBorrowed = Borrowed

A borrowed target, for serialization. This is exposed to the user of the collections in order for them to insert or query the collection.
§

type Buffer = Owned

An owned buffer, for serialization. This is not exposed to the user.
§

type BufferBorrowed = Borrowed

A borrowed buffer, for deserialization. This is not exposed to the user.
§

type SerializeError = Infallible

§

type DeserializeError = Infallible

source§

fn sql_type() -> &'static str

The column type. This is not a constant, because you might want to query the SQLite version to select the best type for the version (for instance, selecting ANY for a STRICT table only where it’s available, and BLOB otherwise).
source§

fn serialize( object: &Self::TargetBorrowed ) -> Result<Self::Buffer, Self::SerializeError>

Serialize a borrowed target into a buffer.
source§

fn deserialize( data: &Self::BufferBorrowed ) -> Result<Self::Target, Self::DeserializeError>

Deserialize a target from a borrowed buffer.

Auto Trait Implementations§

§

impl<Owned, Borrowed: ?Sized> RefUnwindSafe for Direct<Owned, Borrowed>
where Borrowed: RefUnwindSafe, Owned: RefUnwindSafe,

§

impl<Owned, Borrowed: ?Sized> Send for Direct<Owned, Borrowed>
where Borrowed: Send, Owned: Send,

§

impl<Owned, Borrowed: ?Sized> Sync for Direct<Owned, Borrowed>
where Borrowed: Sync, Owned: Sync,

§

impl<Owned, Borrowed: ?Sized> Unpin for Direct<Owned, Borrowed>
where Borrowed: Unpin, Owned: Unpin,

§

impl<Owned, Borrowed: ?Sized> UnwindSafe for Direct<Owned, Borrowed>
where Borrowed: UnwindSafe, Owned: 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> 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<T, U> TryFrom<U> for T
where U: Into<T>,

§

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>,

§

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.