SeedWrapper

Struct SeedWrapper 

Source
#[repr(transparent)]
pub struct SeedWrapper<T>(pub T) where T: ?Sized;
Expand description

A wrapper type that implements serde traits when T implements SATS traits.

Specifically:

Tuple Fields§

§0: T

Implementations§

Source§

impl<T> SerdeWrapper<T>
where T: ?Sized,

Source

pub fn new(t: T) -> SerdeWrapper<T>

Wraps a value in SerdeWrapper.

Source

pub fn from_ref(t: &T) -> &SerdeWrapper<T>

Converts &T to &SerializeWrapper<T>.

Trait Implementations§

Source§

impl<'de, T> Deserialize<'de> for SerdeWrapper<T>
where T: Deserialize<'de>,

Source§

fn deserialize<D>( deserializer: D, ) -> Result<SerdeWrapper<T>, <D as Deserializer<'de>>::Error>
where D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl<'de, T> DeserializeSeed<'de> for SerdeWrapper<T>
where T: DeserializeSeed<'de>,

Source§

type Value = <T as DeserializeSeed<'de>>::Output

The type produced by using this seed.
Source§

fn deserialize<D>( self, de: D, ) -> Result<<SerdeWrapper<T> as DeserializeSeed<'de>>::Value, <D as Deserializer<'de>>::Error>
where D: Deserializer<'de>,

Equivalent to the more common Deserialize::deserialize method, except with some initial piece of data (the seed) passed in.
Source§

impl<T> Serialize for SerdeWrapper<T>
where T: Serialize + ?Sized,

Source§

fn serialize<S>( &self, serializer: S, ) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>
where S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

§

impl<T> Freeze for SerdeWrapper<T>
where T: Freeze + ?Sized,

§

impl<T> RefUnwindSafe for SerdeWrapper<T>
where T: RefUnwindSafe + ?Sized,

§

impl<T> Send for SerdeWrapper<T>
where T: Send + ?Sized,

§

impl<T> Sync for SerdeWrapper<T>
where T: Sync + ?Sized,

§

impl<T> Unpin for SerdeWrapper<T>
where T: Unpin + ?Sized,

§

impl<T> UnwindSafe for SerdeWrapper<T>
where T: UnwindSafe + ?Sized,

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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
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> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,