Skip to main content

BytesPartialEncoderTraits

Trait BytesPartialEncoderTraits 

Source
pub trait BytesPartialEncoderTraits:
    BytesPartialDecoderTraits
    + Any
    + MaybeSend
    + MaybeSync {
    // Required methods
    fn into_dyn_decoder(self: Arc<Self>) -> Arc<dyn BytesPartialDecoderTraits>;
    fn erase(&self) -> Result<(), CodecError>;
    fn partial_encode_many(
        &self,
        offset_values: OffsetBytesIterator<'_, ArrayBytesRaw<'_>>,
        options: &CodecOptions,
    ) -> Result<(), CodecError>;
    fn supports_partial_encode(&self) -> bool;

    // Provided method
    fn partial_encode(
        &self,
        offset: u64,
        bytes: ArrayBytesRaw<'_>,
        options: &CodecOptions,
    ) -> Result<(), CodecError> { ... }
}
Expand description

Partial bytes encoder traits.

Required Methods§

Source

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

Return the encoder as an Arc<BytesPartialDecoderTraits>.

Source

fn erase(&self) -> Result<(), CodecError>

Erase the chunk.

§Errors

Returns an error if there is an underlying store error.

Source

fn partial_encode_many( &self, offset_values: OffsetBytesIterator<'_, ArrayBytesRaw<'_>>, options: &CodecOptions, ) -> Result<(), CodecError>

Partially encode a chunk from an OffsetBytesIterator.

§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( &self, offset: u64, bytes: ArrayBytesRaw<'_>, options: &CodecOptions, ) -> Result<(), CodecError>

Partially encode a chunk.

§Errors

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

Implementations on Foreign Types§

Source§

impl BytesPartialEncoderTraits for Mutex<Option<Vec<u8>>>

Implementors§