Trait zarrs::array::codec::ArrayToBytesCodecTraits

source ·
pub trait ArrayToBytesCodecTraits: ArrayCodecTraits + DynClone + Debug {
    // Required methods
    fn compute_encoded_size(
        &self,
        decoded_representation: &ChunkRepresentation
    ) -> Result<BytesRepresentation, CodecError>;
    fn partial_decoder<'a>(
        &'a self,
        input_handle: Box<dyn BytesPartialDecoderTraits + 'a>,
        decoded_representation: &ChunkRepresentation,
        options: &CodecOptions
    ) -> Result<Box<dyn ArrayPartialDecoderTraits + 'a>, CodecError>;
    fn async_partial_decoder<'a, 'life0, 'life1, 'async_trait>(
        &'a self,
        input_handle: Box<dyn AsyncBytesPartialDecoderTraits + 'a>,
        decoded_representation: &'life0 ChunkRepresentation,
        options: &'life1 CodecOptions
    ) -> Pin<Box<dyn Future<Output = Result<Box<dyn AsyncArrayPartialDecoderTraits + 'a>, CodecError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'a: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
}
Expand description

Traits for array to bytes codecs.

Required Methods§

source

fn compute_encoded_size( &self, decoded_representation: &ChunkRepresentation ) -> Result<BytesRepresentation, CodecError>

Returns the size of the encoded representation given a size of the decoded representation.

§Errors

Returns a CodecError if the decoded representation is not supported by this codec.

source

fn partial_decoder<'a>( &'a self, input_handle: Box<dyn BytesPartialDecoderTraits + 'a>, decoded_representation: &ChunkRepresentation, options: &CodecOptions ) -> Result<Box<dyn ArrayPartialDecoderTraits + 'a>, CodecError>

Initialise a partial decoder.

§Errors

Returns a CodecError if initialisation fails.

source

fn async_partial_decoder<'a, 'life0, 'life1, 'async_trait>( &'a self, input_handle: Box<dyn AsyncBytesPartialDecoderTraits + 'a>, decoded_representation: &'life0 ChunkRepresentation, options: &'life1 CodecOptions ) -> Pin<Box<dyn Future<Output = Result<Box<dyn AsyncArrayPartialDecoderTraits + 'a>, CodecError>> + Send + 'async_trait>>
where Self: 'async_trait, 'a: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Available on crate feature async only.

Initialise an asynchronous partial decoder.

§Errors

Returns a CodecError if initialisation fails.

Implementors§

source§

impl ArrayToBytesCodecTraits for BytesCodec

source§

impl ArrayToBytesCodecTraits for CodecChain

source§

impl ArrayToBytesCodecTraits for PcodecCodec

Available on crate feature pcodec only.
source§

impl ArrayToBytesCodecTraits for ShardingCodec

Available on crate feature sharding only.
source§

impl ArrayToBytesCodecTraits for ZfpCodec

Available on crate feature zfp only.