Trait numcodecs::DynCodecType
source · pub trait DynCodecType:
'static
+ Send
+ Sync {
type Codec: DynCodec<Type = Self>;
// Required methods
fn codec_id(&self) -> &str;
fn codec_config_schema(&self) -> Schema;
fn codec_from_config<'de, D: Deserializer<'de>>(
&self,
config: D,
) -> Result<Self::Codec, D::Error>;
}
Expand description
Type object for dynamically typed compression codecs.
Required Associated Types§
Required Methods§
sourcefn codec_config_schema(&self) -> Schema
fn codec_config_schema(&self) -> Schema
JSON schema for the codec’s configuration.
sourcefn 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 config
uration.
The config
must not contain an id
field. If the config
may
contain one, use the codec_from_config_with_id
helper function.
The config
must be compatible with JSON encoding.
§Errors
Errors if constructing the codec fails.
Object Safety§
This trait is not object safe.