Struct fbthrift_git::adapter::ListMapAdapter
source · pub struct ListMapAdapter<A>where
A: ThriftAdapter,{ /* private fields */ }
Expand description
Transforms the given adapter A
into an adapter with the signature Vec<StandardType>
-> Vec<AdaptedType>
. Because Rust doesn’t have HKT, we cannot make this “generic” over
multiple collection types.
Trait Implementations§
source§impl<A> ThriftAdapter for ListMapAdapter<A>where
A: ThriftAdapter,
impl<A> ThriftAdapter for ListMapAdapter<A>where
A: ThriftAdapter,
§type StandardType = Vec<<A as ThriftAdapter>::StandardType>
type StandardType = Vec<<A as ThriftAdapter>::StandardType>
Aka the “from” type.
§type AdaptedType = Vec<<A as ThriftAdapter>::AdaptedType>
type AdaptedType = Vec<<A as ThriftAdapter>::AdaptedType>
Aka the “to” type.
§type Error = <A as ThriftAdapter>::Error
type Error = <A as ThriftAdapter>::Error
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<A> RefUnwindSafe for ListMapAdapter<A>where
A: RefUnwindSafe,
impl<A> Send for ListMapAdapter<A>where
A: Send,
impl<A> Sync for ListMapAdapter<A>where
A: Sync,
impl<A> Unpin for ListMapAdapter<A>where
A: Unpin,
impl<A> UnwindSafe for ListMapAdapter<A>where
A: 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