Skip to main content

ArrayPartialDecoderTraits

Trait ArrayPartialDecoderTraits 

Source
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§

Source

fn data_type(&self) -> &DataType

Return the data type of the partial decoder.

Source

fn exists(&self) -> Result<bool, StorageError>

Returns whether the chunk exists.

§Errors

Returns StorageError if a storage operation fails.

Source

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.

Source

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.

Source

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§

Source

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,

Implementors§