pub trait Codec:
'static
+ Send
+ Sync
+ Clone {
type Error: 'static + Send + Sync + Error;
// Required methods
fn encode(&self, data: AnyCowArray<'_>) -> Result<AnyArray, Self::Error>;
fn decode(&self, encoded: AnyCowArray<'_>) -> Result<AnyArray, Self::Error>;
fn decode_into(
&self,
encoded: AnyArrayView<'_>,
decoded: AnyArrayViewMut<'_>,
) -> Result<(), Self::Error>;
}
Required Associated Types§
Required Methods§
Sourcefn decode_into(
&self,
encoded: AnyArrayView<'_>,
decoded: AnyArrayViewMut<'_>,
) -> Result<(), Self::Error>
fn decode_into( &self, encoded: AnyArrayView<'_>, decoded: AnyArrayViewMut<'_>, ) -> Result<(), Self::Error>
Decodes the encoded
data and writes the result into the provided
decoded
output.
The output must have the correct type and shape.
§Errors
Errors if decoding the buffer fails.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.