pub struct IdentityAdapter<T>{ /* private fields */ }Expand description
No-op adapter. Used if the key of a map is an adapted type, but the value isn’t, or vice versa.
Trait Implementations§
Source§impl<T> ThriftAdapter for IdentityAdapter<T>
impl<T> ThriftAdapter for IdentityAdapter<T>
Source§type StandardType = T
type StandardType = T
Aka the “from” type.
Source§type AdaptedType = T
type AdaptedType = T
Aka the “to” type.
Source§type Error = Infallible
type Error = Infallible
The error type thrown if
from_thrift fails during deserialization.Source§fn from_thrift(
value: Self::StandardType,
) -> Result<Self::AdaptedType, Self::Error>
fn from_thrift( value: Self::StandardType, ) -> Result<Self::AdaptedType, Self::Error>
Source§fn to_thrift(value: &Self::AdaptedType) -> Self::StandardType
fn to_thrift(value: &Self::AdaptedType) -> Self::StandardType
Source§fn from_thrift_field<T: ThriftAnnotations>(
value: Self::StandardType,
_field_id: i16,
) -> Result<Self::AdaptedType, Self::Error>
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 moreSource§fn to_thrift_field<T: ThriftAnnotations>(
value: &Self::AdaptedType,
_field_id: i16,
) -> Self::StandardType
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 moreSource§fn from_thrift_default<T: ThriftAnnotations>(
value: Self::StandardType,
field_id: i16,
) -> Self::AdaptedType
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 moreAuto Trait Implementations§
impl<T> Freeze for IdentityAdapter<T>
impl<T> RefUnwindSafe for IdentityAdapter<T>where
T: RefUnwindSafe,
impl<T> Send for IdentityAdapter<T>
impl<T> Sync for IdentityAdapter<T>
impl<T> Unpin for IdentityAdapter<T>where
T: Unpin,
impl<T> UnwindSafe for IdentityAdapter<T>where
T: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more