Trait zarrs::array::codec::CodecTraits

source ·
pub trait CodecTraits: Send + Sync {
    // Required methods
    fn create_metadata_opt(
        &self,
        options: &ArrayMetadataOptions
    ) -> Option<Metadata>;
    fn partial_decoder_should_cache_input(&self) -> bool;
    fn partial_decoder_decodes_all(&self) -> bool;

    // Provided method
    fn create_metadata(&self) -> Option<Metadata> { ... }
}
Expand description

Codec traits.

Required Methods§

source

fn create_metadata_opt( &self, options: &ArrayMetadataOptions ) -> Option<Metadata>

Create metadata.

A hidden codec (e.g. a cache) will return None, since it will not have any associated metadata.

source

fn partial_decoder_should_cache_input(&self) -> bool

Indicates if the input to a codecs partial decoder should be cached for optimal performance. If true, a cache may be inserted before it in a CodecChain partial decoder.

source

fn partial_decoder_decodes_all(&self) -> bool

Indicates if a partial decoder decodes all bytes from its input handle and its output should be cached for optimal performance. If true, a cache will be inserted at some point after it in a CodecChain partial decoder.

Provided Methods§

source

fn create_metadata(&self) -> Option<Metadata>

Create metadata with default options.

A hidden codec (e.g. a cache) will return None, since it will not have any associated metadata.

Implementors§

source§

impl CodecTraits for BitroundCodec

Available on crate feature bitround only.
source§

impl CodecTraits for TransposeCodec

Available on crate feature transpose only.
source§

impl CodecTraits for BytesCodec

source§

impl CodecTraits for CodecChain

source§

impl CodecTraits for PcodecCodec

Available on crate feature pcodec only.
source§

impl CodecTraits for ShardingCodec

Available on crate feature sharding only.
source§

impl CodecTraits for ZfpCodec

Available on crate feature zfp only.
source§

impl CodecTraits for BloscCodec

Available on crate feature blosc only.
source§

impl CodecTraits for Bz2Codec

Available on crate feature bz2 only.
source§

impl CodecTraits for Crc32cCodec

Available on crate feature crc32c only.
source§

impl CodecTraits for GzipCodec

Available on crate feature gzip only.
source§

impl CodecTraits for ZstdCodec

Available on crate feature zstd only.