Skip to main content

AsyncBytesPartialEncoderTraits

Trait AsyncBytesPartialEncoderTraits 

Source
pub trait AsyncBytesPartialEncoderTraits:
    AsyncBytesPartialDecoderTraits
    + Any
    + Send
    + Sync {
    // Required methods
    fn into_dyn_decoder(
        self: Arc<Self>,
    ) -> Arc<dyn AsyncBytesPartialDecoderTraits>;
    fn erase<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Result<(), CodecError>> + Send + 'async_trait>>
       where 'life0: 'async_trait,
             Self: 'async_trait;
    fn partial_encode_many<'a, 'life0, 'life1, 'async_trait>(
        &'a self,
        offset_values: Box<dyn MaybeSendOffsetBytesIterator<Cow<'life0, [u8]>, Item = (u64, Cow<'life0, [u8]>)> + 'a>,
        options: &'life1 CodecOptions,
    ) -> Pin<Box<dyn Future<Output = Result<(), CodecError>> + Send + 'async_trait>>
       where 'a: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             Self: 'async_trait;
    fn supports_partial_encode(&self) -> bool;

    // Provided method
    fn partial_encode<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        offset: u64,
        bytes: Cow<'life1, [u8]>,
        options: &'life2 CodecOptions,
    ) -> Pin<Box<dyn Future<Output = Result<(), CodecError>> + Send + 'async_trait>>
       where 'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait,
             Self: Sync + 'async_trait { ... }
}
Available on crate feature async only.
Expand description

Asynhronous partial bytes encoder traits.

Required Methods§

Source

fn into_dyn_decoder(self: Arc<Self>) -> Arc<dyn AsyncBytesPartialDecoderTraits>

Return the encoder as an Arc<AsyncBytesPartialDecoderTraits>.

Source

fn erase<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<(), CodecError>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: 'async_trait,

Erase the chunk.

§Errors

Returns an error if there is an underlying store error.

Source

fn partial_encode_many<'a, 'life0, 'life1, 'async_trait>( &'a self, offset_values: Box<dyn MaybeSendOffsetBytesIterator<Cow<'life0, [u8]>, Item = (u64, Cow<'life0, [u8]>)> + 'a>, options: &'life1 CodecOptions, ) -> Pin<Box<dyn Future<Output = Result<(), CodecError>> + Send + 'async_trait>>
where 'a: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, Self: 'async_trait,

Partially encode a chunk.

§Errors

Returns CodecError if a codec fails or a byte range is invalid.

Source

fn supports_partial_encode(&self) -> bool

Returns whether this encoder supports partial encoding.

If this returns true, the encoder can efficiently handle partial encoding operations. If this returns false, partial encoding will fall back to a full decode and encode operation.

Provided Methods§

Source

fn partial_encode<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, offset: u64, bytes: Cow<'life1, [u8]>, options: &'life2 CodecOptions, ) -> Pin<Box<dyn Future<Output = Result<(), CodecError>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, Self: Sync + 'async_trait,

Partially encode a chunk.

§Errors

Returns CodecError if a codec fails or the byte range is invalid.

Implementors§