pub trait ArrayPartialDecoderTraits:
Any
+ MaybeSend
+ MaybeSync {
// Required methods
fn data_type(&self) -> &DataType;
fn exists(&self) -> Result<bool, StorageError>;
fn size_held(&self) -> usize;
fn partial_decode(
&self,
indexer: &dyn Indexer,
options: &CodecOptions,
) -> Result<ArrayBytes<'_>, CodecError>;
fn supports_partial_decode(&self) -> bool;
// Provided method
fn partial_decode_into(
&self,
indexer: &dyn Indexer,
output_target: ArrayBytesDecodeIntoTarget<'_>,
options: &CodecOptions,
) -> Result<(), CodecError> { ... }
}Expand description
Partial array decoder traits.
Required Methods§
Sourcefn exists(&self) -> Result<bool, StorageError>
fn exists(&self) -> Result<bool, StorageError>
Sourcefn size_held(&self) -> usize
fn size_held(&self) -> usize
Returns the size of chunk bytes held by the partial decoder.
Intended for use by size-constrained partial decoder caches.
Sourcefn partial_decode(
&self,
indexer: &dyn Indexer,
options: &CodecOptions,
) -> Result<ArrayBytes<'_>, CodecError>
fn partial_decode( &self, indexer: &dyn Indexer, options: &CodecOptions, ) -> Result<ArrayBytes<'_>, CodecError>
Partially decode a chunk.
If the inner input_handle is a bytes decoder and partial decoding returns None, then the array subsets have the fill value.
§Errors
Returns CodecError if a codec fails or an array subset is invalid.
Sourcefn supports_partial_decode(&self) -> bool
fn supports_partial_decode(&self) -> bool
Returns whether this decoder supports partial decoding.
If this returns true, the decoder can efficiently handle partial decoding operations.
If this returns false, partial decoding will fall back to a full decode operation.
Provided Methods§
Sourcefn partial_decode_into(
&self,
indexer: &dyn Indexer,
output_target: ArrayBytesDecodeIntoTarget<'_>,
options: &CodecOptions,
) -> Result<(), CodecError>
fn partial_decode_into( &self, indexer: &dyn Indexer, output_target: ArrayBytesDecodeIntoTarget<'_>, options: &CodecOptions, ) -> Result<(), CodecError>
Partially decode into a preallocated output.
This method is intended for internal use by Array. It currently only works for fixed length data types.
The indexer shape and dimensionality does not need to match output_subset, but the number of elements must match.
Extracted elements from the indexer are written as ordered by the indexer.
For an ArraySubset, that is C order.
§Errors
Returns CodecError if a codec fails or the number of elements in indexer does not match the number of elements in output_view,