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§
sourcefn partial_decode(
&self,
decoded_regions: &[ByteRange],
options: &CodecOptions
) -> Result<Option<Vec<Vec<u8>>>, CodecError>
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§
sourcefn partial_decode_concat(
&self,
decoded_regions: &[ByteRange],
options: &CodecOptions
) -> Result<Option<Vec<u8>>, CodecError>
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.
sourcefn decode(&self, options: &CodecOptions) -> Result<MaybeBytes, CodecError>
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.