LayeredThriftAdapter

Struct LayeredThriftAdapter 

Source
pub struct LayeredThriftAdapter<Fst, Snd>{ /* private fields */ }

Trait Implementations§

Source§

impl<Fst, Snd> ThriftAdapter for LayeredThriftAdapter<Fst, Snd>

Source§

type StandardType = <Snd as ThriftAdapter>::StandardType

Aka the “from” type.
Source§

type AdaptedType = <Fst as ThriftAdapter>::AdaptedType

Aka the “to” type.
Source§

type Error = Error

The error type thrown if from_thrift fails during deserialization.
Source§

fn from_thrift( value: Self::StandardType, ) -> Result<Self::AdaptedType, Self::Error>

Converts an instance of StandardType to AdaptedType during deserialization. Read more
Source§

fn to_thrift(value: &Self::AdaptedType) -> Self::StandardType

Converts from the given AdaptedType back to the given StandardType during serialization. Read more
Source§

fn from_thrift_field<T: ThriftAnnotations>( value: Self::StandardType, field_id: i16, ) -> Result<Self::AdaptedType, Self::Error>

Method called when this adapter is used on a Thrift struct’s field. Provides information about the specific field ID in field_id. The type of the struct that owns this field is passed in as T. Read more
Source§

fn to_thrift_field<T: ThriftAnnotations>( value: &Self::AdaptedType, field_id: i16, ) -> Self::StandardType

Method called when this adapter is used on a Thrift struct’s field. Provides information about the specific field ID in field_id. The type of the struct that owns this field is passed in as T. Read more
Source§

fn from_thrift_default<T: ThriftAnnotations>( value: Self::StandardType, field_id: i16, ) -> Self::AdaptedType

Method called when the adapted type is not present in a field during deserialization or is populated with ..Default::default(). The value passed here is the default original type value for the field. This can be used to record that the field was not present inside of your adapted type. Read more

Auto Trait Implementations§

§

impl<Fst, Snd> Freeze for LayeredThriftAdapter<Fst, Snd>

§

impl<Fst, Snd> RefUnwindSafe for LayeredThriftAdapter<Fst, Snd>

§

impl<Fst, Snd> Send for LayeredThriftAdapter<Fst, Snd>
where <Snd as ThriftAdapter>::AdaptedType: Sized, <Fst as ThriftAdapter>::StandardType: Sized, Fst: Send, Snd: Send,

§

impl<Fst, Snd> Sync for LayeredThriftAdapter<Fst, Snd>
where <Snd as ThriftAdapter>::AdaptedType: Sized, <Fst as ThriftAdapter>::StandardType: Sized, Fst: Sync, Snd: Sync,

§

impl<Fst, Snd> Unpin for LayeredThriftAdapter<Fst, Snd>
where <Snd as ThriftAdapter>::AdaptedType: Sized, <Fst as ThriftAdapter>::StandardType: Sized, Fst: Unpin, Snd: Unpin,

§

impl<Fst, Snd> UnwindSafe for LayeredThriftAdapter<Fst, Snd>

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

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.