Skip to main content

ArrayCodecTraits

Trait ArrayCodecTraits 

Source
pub trait ArrayCodecTraits: CodecTraits {
    // Required method
    fn recommended_concurrency(
        &self,
        shape: &[NonZero<u64>],
        data_type: &DataType,
    ) -> Result<RecommendedConcurrency, CodecError>;

    // Provided method
    fn partial_decode_granularity(
        &self,
        shape: &[NonZero<u64>],
    ) -> Vec<NonZero<u64>> { ... }
}
Expand description

Traits for both array to array and array to bytes codecs.

Required Methods§

Source

fn recommended_concurrency( &self, shape: &[NonZero<u64>], data_type: &DataType, ) -> Result<RecommendedConcurrency, CodecError>

Return the recommended concurrency for the requested decoded representation.

§Errors

Returns CodecError if the decoded representation is not valid for the codec.

Provided Methods§

Source

fn partial_decode_granularity( &self, shape: &[NonZero<u64>], ) -> Vec<NonZero<u64>>

Return the partial decode granularity.

This represents the shape of the smallest subset of a chunk that can be efficiently decoded if the chunk were subdivided into a regular grid. For most codecs, this is just the shape of the chunk. It is the shape of the sub chunks (inner chunks) for the sharding codec.

Implementors§