pub trait AsyncBytesPartialDecoderTraits:
Any
+ Send
+ Sync {
// Required methods
fn exists<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<bool, StorageError>> + Send + 'async_trait>>
where 'life0: 'async_trait,
Self: 'async_trait;
fn size_held(&self) -> usize;
fn partial_decode_many<'a, 'life0, 'async_trait>(
&'a self,
decoded_regions: Box<dyn MaybeSendByteRangeIterator<Item = ByteRange> + 'a>,
options: &'life0 CodecOptions,
) -> Pin<Box<dyn Future<Output = Result<Option<Vec<Cow<'a, [u8]>>>, CodecError>> + Send + 'async_trait>>
where 'a: 'async_trait,
'life0: 'async_trait,
Self: 'async_trait;
fn supports_partial_decode(&self) -> bool;
// Provided methods
fn partial_decode<'a, 'life0, 'async_trait>(
&'a self,
decoded_region: ByteRange,
options: &'life0 CodecOptions,
) -> Pin<Box<dyn Future<Output = Result<Option<Cow<'a, [u8]>>, CodecError>> + Send + 'async_trait>>
where 'a: 'async_trait,
'life0: 'async_trait,
Self: Sync + 'async_trait { ... }
fn decode<'a, 'life0, 'async_trait>(
&'a self,
options: &'life0 CodecOptions,
) -> Pin<Box<dyn Future<Output = Result<Option<Cow<'a, [u8]>>, CodecError>> + Send + 'async_trait>>
where 'a: 'async_trait,
'life0: 'async_trait,
Self: Sync + 'async_trait { ... }
}async only.Expand description
Asynchronous partial bytes decoder traits.
Required Methods§
Sourcefn exists<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<bool, StorageError>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
fn exists<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<bool, StorageError>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
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<'a, 'life0, 'async_trait>(
&'a self,
decoded_regions: Box<dyn MaybeSendByteRangeIterator<Item = ByteRange> + 'a>,
options: &'life0 CodecOptions,
) -> Pin<Box<dyn Future<Output = Result<Option<Vec<Cow<'a, [u8]>>>, CodecError>> + Send + 'async_trait>>where
'a: 'async_trait,
'life0: 'async_trait,
Self: 'async_trait,
fn partial_decode_many<'a, 'life0, 'async_trait>(
&'a self,
decoded_regions: Box<dyn MaybeSendByteRangeIterator<Item = ByteRange> + 'a>,
options: &'life0 CodecOptions,
) -> Pin<Box<dyn Future<Output = Result<Option<Vec<Cow<'a, [u8]>>>, CodecError>> + Send + 'async_trait>>where
'a: 'async_trait,
'life0: 'async_trait,
Self: 'async_trait,
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<'a, 'life0, 'async_trait>(
&'a self,
decoded_region: ByteRange,
options: &'life0 CodecOptions,
) -> Pin<Box<dyn Future<Output = Result<Option<Cow<'a, [u8]>>, CodecError>> + Send + 'async_trait>>where
'a: 'async_trait,
'life0: 'async_trait,
Self: Sync + 'async_trait,
fn partial_decode<'a, 'life0, 'async_trait>(
&'a self,
decoded_region: ByteRange,
options: &'life0 CodecOptions,
) -> Pin<Box<dyn Future<Output = Result<Option<Cow<'a, [u8]>>, CodecError>> + Send + 'async_trait>>where
'a: 'async_trait,
'life0: 'async_trait,
Self: Sync + 'async_trait,
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<'a, 'life0, 'async_trait>(
&'a self,
options: &'life0 CodecOptions,
) -> Pin<Box<dyn Future<Output = Result<Option<Cow<'a, [u8]>>, CodecError>> + Send + 'async_trait>>where
'a: 'async_trait,
'life0: 'async_trait,
Self: Sync + 'async_trait,
fn decode<'a, 'life0, 'async_trait>(
&'a self,
options: &'life0 CodecOptions,
) -> Pin<Box<dyn Future<Output = Result<Option<Cow<'a, [u8]>>, CodecError>> + Send + 'async_trait>>where
'a: 'async_trait,
'life0: 'async_trait,
Self: Sync + 'async_trait,
Decode all bytes.
Returns None if partial decoding of the input handle returns None.
§Errors
Returns CodecError if a codec fails.