pub struct ErasedDynCodecType { /* private fields */ }Expand description
Type-erased dynamically typed compression codec type.
Implementations§
Source§impl ErasedDynCodecType
impl ErasedDynCodecType
Sourcepub fn new<T: DynCodecType>(ty: T) -> Self
pub fn new<T: DynCodecType>(ty: T) -> Self
Erase the type information of the concrete codec type.
Sourcepub fn downcast<T: DynCodecType>(self) -> Result<T, Self>
pub fn downcast<T: DynCodecType>(self) -> Result<T, Self>
Try to downcast into a concretely-typed codec type.
§Errors
Returns self if the type-erased codec type is not of the concrete
type.
Sourcepub fn downcast_ref<T: DynCodecType>(&self) -> Option<&T>
pub fn downcast_ref<T: DynCodecType>(&self) -> Option<&T>
Try to downcast to a concretely-typed codec type reference.
Sourcepub fn downcast_mut<T: DynCodecType>(&mut self) -> Option<&mut T>
pub fn downcast_mut<T: DynCodecType>(&mut self) -> Option<&mut T>
Try to downcast to a concretely-typed mutable codec type reference.
Trait Implementations§
Source§impl DynCodecType for ErasedDynCodecType
impl DynCodecType for ErasedDynCodecType
Source§type Codec = ErasedDynCodec
type Codec = ErasedDynCodec
Type of the instances of this codec type object.
Source§fn codec_config_schema(&self) -> Schema
fn codec_config_schema(&self) -> Schema
JSON schema for the codec’s configuration.
Source§fn codec_from_config<'de, D: Deserializer<'de>>(
&self,
config: D,
) -> Result<Self::Codec, D::Error>
fn codec_from_config<'de, D: Deserializer<'de>>( &self, config: D, ) -> Result<Self::Codec, D::Error>
Instantiate a codec of this type from a serialized
configuration. Read moreAuto Trait Implementations§
impl Freeze for ErasedDynCodecType
impl !RefUnwindSafe for ErasedDynCodecType
impl Send for ErasedDynCodecType
impl Sync for ErasedDynCodecType
impl Unpin for ErasedDynCodecType
impl UnsafeUnpin for ErasedDynCodecType
impl !UnwindSafe for ErasedDynCodecType
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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