pub trait BytesPartialDecoderTraits:
Any
+ MaybeSend
+ MaybeSync {
// Required methods
fn exists(&self) -> Result<bool, StorageError>;
fn size_held(&self) -> usize;
fn partial_decode_many(
&self,
decoded_regions: ByteRangeIterator<'_>,
options: &CodecOptions,
) -> Result<Option<Vec<ArrayBytesRaw<'_>>>, CodecError>;
fn supports_partial_decode(&self) -> bool;
// Provided methods
fn partial_decode(
&self,
decoded_region: ByteRange,
options: &CodecOptions,
) -> Result<Option<ArrayBytesRaw<'_>>, CodecError> { ... }
fn decode(
&self,
options: &CodecOptions,
) -> Result<Option<ArrayBytesRaw<'_>>, CodecError> { ... }
}Expand description
Partial bytes 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_many(
&self,
decoded_regions: ByteRangeIterator<'_>,
options: &CodecOptions,
) -> Result<Option<Vec<ArrayBytesRaw<'_>>>, CodecError>
fn partial_decode_many( &self, decoded_regions: ByteRangeIterator<'_>, options: &CodecOptions, ) -> Result<Option<Vec<ArrayBytesRaw<'_>>>, CodecError>
Partially decode byte ranges.
Returns None if partial decoding of the input handle returns None.
§Errors
Returns CodecError if a codec fails or a byte range 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(
&self,
decoded_region: ByteRange,
options: &CodecOptions,
) -> Result<Option<ArrayBytesRaw<'_>>, CodecError>
fn partial_decode( &self, decoded_region: ByteRange, options: &CodecOptions, ) -> Result<Option<ArrayBytesRaw<'_>>, CodecError>
Partially decode a byte range.
Returns None if partial decoding of the input handle returns None.
§Errors
Returns CodecError if a codec fails or the byte range is invalid.
Sourcefn decode(
&self,
options: &CodecOptions,
) -> Result<Option<ArrayBytesRaw<'_>>, CodecError>
fn decode( &self, options: &CodecOptions, ) -> Result<Option<ArrayBytesRaw<'_>>, CodecError>
Decode all bytes.
Returns None if partial decoding of the input handle returns None.
§Errors
Returns CodecError if a codec fails.