Trait zarrs::array::codec::BytesPartialDecoderTraits

source ·
pub trait BytesPartialDecoderTraits: Send + Sync {
    // Required method
    fn partial_decode(
        &self,
        decoded_regions: &[ByteRange],
        options: &CodecOptions
    ) -> Result<Option<Vec<Vec<u8>>>, CodecError>;

    // Provided methods
    fn partial_decode_concat(
        &self,
        decoded_regions: &[ByteRange],
        options: &CodecOptions
    ) -> Result<Option<Vec<u8>>, CodecError> { ... }
    fn decode(&self, options: &CodecOptions) -> Result<MaybeBytes, CodecError> { ... }
}
Expand description

Partial bytes decoder traits.

Required Methods§

source

fn partial_decode( &self, decoded_regions: &[ByteRange], options: &CodecOptions ) -> Result<Option<Vec<Vec<u8>>>, CodecError>

Partially decode bytes.

Returns None if partial decoding of the input handle returns None.

§Errors

Returns CodecError if a codec fails or a byte range is invalid.

Provided Methods§

source

fn partial_decode_concat( &self, decoded_regions: &[ByteRange], options: &CodecOptions ) -> Result<Option<Vec<u8>>, CodecError>

Partially decode bytes and concatenate.

Returns None if partial decoding of the input handle returns None.

Codecs can manually implement this method with a preallocated array to reduce internal allocations.

§Errors

Returns CodecError if a codec fails or a byte range is invalid.

source

fn decode(&self, options: &CodecOptions) -> Result<MaybeBytes, CodecError>

Decode all bytes.

Returns None if partial decoding of the input handle returns None.

§Errors

Returns CodecError if a codec fails.

Implementations on Foreign Types§

source§

impl BytesPartialDecoderTraits for Cursor<&[u8]>

source§

fn partial_decode( &self, decoded_regions: &[ByteRange], _parallel: &CodecOptions ) -> Result<Option<Vec<Vec<u8>>>, CodecError>

source§

impl BytesPartialDecoderTraits for Cursor<Vec<u8>>

source§

fn partial_decode( &self, decoded_regions: &[ByteRange], _parallel: &CodecOptions ) -> Result<Option<Vec<Vec<u8>>>, CodecError>

Implementors§