pub struct ErasedDynCodec { /* private fields */ }Expand description
Type-erased dynamically typed compression codec.
Implementations§
Source§impl ErasedDynCodec
impl ErasedDynCodec
Sourcepub fn downcast<T: DynCodec>(self) -> Result<T, Self>
pub fn downcast<T: DynCodec>(self) -> Result<T, Self>
Try to downcast into a concretely-typed codec.
§Errors
Returns self if the type-erased codec is not of the concrete type.
Sourcepub fn downcast_ref<T: DynCodec>(&self) -> Option<&T>
pub fn downcast_ref<T: DynCodec>(&self) -> Option<&T>
Try to downcast to a concretely-typed codec reference.
Sourcepub fn downcast_mut<T: DynCodec>(&mut self) -> Option<&mut T>
pub fn downcast_mut<T: DynCodec>(&mut self) -> Option<&mut T>
Try to downcast to a concretely-typed mutable codec reference.
Sourcepub fn codec_config_schema(generator: &mut SchemaGenerator) -> Schema
pub fn codec_config_schema(generator: &mut SchemaGenerator) -> Schema
Generate the schema for any codec config.
Trait Implementations§
Source§impl Clone for ErasedDynCodec
impl Clone for ErasedDynCodec
Source§impl Codec for ErasedDynCodec
impl Codec for ErasedDynCodec
Source§fn encode(&self, data: AnyCowArray<'_>) -> Result<AnyArray, Self::Error>
fn encode(&self, data: AnyCowArray<'_>) -> Result<AnyArray, Self::Error>
Encodes the
data and returns the result. Read moreSource§fn decode(&self, encoded: AnyCowArray<'_>) -> Result<AnyArray, Self::Error>
fn decode(&self, encoded: AnyCowArray<'_>) -> Result<AnyArray, Self::Error>
Decodes the
encoded data and returns the result. Read moreSource§fn decode_into(
&self,
encoded: AnyArrayView<'_>,
decoded: AnyArrayViewMut<'_>,
) -> Result<(), Self::Error>
fn decode_into( &self, encoded: AnyArrayView<'_>, decoded: AnyArrayViewMut<'_>, ) -> Result<(), Self::Error>
Source§impl DynCodec for ErasedDynCodec
impl DynCodec for ErasedDynCodec
Auto Trait Implementations§
impl Freeze for ErasedDynCodec
impl !RefUnwindSafe for ErasedDynCodec
impl Send for ErasedDynCodec
impl Sync for ErasedDynCodec
impl Unpin for ErasedDynCodec
impl UnsafeUnpin for ErasedDynCodec
impl !UnwindSafe for ErasedDynCodec
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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