Struct ZstdCodec

Source
pub struct ZstdCodec { /* private fields */ }
Available on crate feature zstd only.
Expand description

A zstd codec implementation.

Implementations§

Source§

impl ZstdCodec

Source

pub const fn new(compression: CompressionLevel, checksum: bool) -> Self

Create a new Zstd codec.

Source

pub fn new_with_configuration( configuration: &ZstdCodecConfiguration, ) -> Result<Self, PluginCreateError>

Create a new Zstd codec from configuration.

§Errors

Returns an error if the configuration is not supported.

Trait Implementations§

Source§

impl BytesToBytesCodecTraits for ZstdCodec

Source§

fn into_dyn(self: Arc<Self>) -> Arc<dyn BytesToBytesCodecTraits>

Return a dynamic version of the codec.
Source§

fn recommended_concurrency( &self, _decoded_representation: &BytesRepresentation, ) -> Result<RecommendedConcurrency, CodecError>

Return the maximum internal concurrency supported for the requested decoded representation. Read more
Source§

fn encode<'a>( &self, decoded_value: RawBytes<'a>, _options: &CodecOptions, ) -> Result<RawBytes<'a>, CodecError>

Encode chunk bytes. Read more
Source§

fn decode<'a>( &self, encoded_value: RawBytes<'a>, _decoded_representation: &BytesRepresentation, _options: &CodecOptions, ) -> Result<RawBytes<'a>, CodecError>

Decode chunk bytes. Read more
Source§

fn encoded_representation( &self, decoded_representation: &BytesRepresentation, ) -> BytesRepresentation

Returns the size of the encoded representation given a size of the decoded representation.
Source§

fn partial_decoder( self: Arc<Self>, input_handle: Arc<dyn BytesPartialDecoderTraits>, decoded_representation: &BytesRepresentation, options: &CodecOptions, ) -> Result<Arc<dyn BytesPartialDecoderTraits>, CodecError>

Initialises a partial decoder. Read more
Source§

fn partial_encoder( self: Arc<Self>, input_handle: Arc<dyn BytesPartialDecoderTraits>, output_handle: Arc<dyn BytesPartialEncoderTraits>, decoded_representation: &BytesRepresentation, options: &CodecOptions, ) -> Result<Arc<dyn BytesPartialEncoderTraits>, CodecError>

Initialise a partial encoder. Read more
Source§

fn async_partial_decoder<'life0, 'life1, 'async_trait>( self: Arc<Self>, input_handle: Arc<dyn AsyncBytesPartialDecoderTraits>, decoded_representation: &'life0 BytesRepresentation, options: &'life1 CodecOptions, ) -> Pin<Box<dyn Future<Output = Result<Arc<dyn AsyncBytesPartialDecoderTraits>, CodecError>> + Send + 'async_trait>>
where Self: Sync + Send + 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Available on crate feature async only.
Initialises an asynchronous partial decoder. Read more
Source§

fn async_partial_encoder<'life0, 'life1, 'async_trait>( self: Arc<Self>, input_handle: Arc<dyn AsyncBytesPartialDecoderTraits>, output_handle: Arc<dyn AsyncBytesPartialEncoderTraits>, decoded_representation: &'life0 BytesRepresentation, options: &'life1 CodecOptions, ) -> Pin<Box<dyn Future<Output = Result<Arc<dyn AsyncBytesPartialEncoderTraits>, CodecError>> + Send + 'async_trait>>
where Self: Sync + Send + 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Available on crate feature async only.
Initialise an asynchronous partial encoder. Read more
Source§

impl Clone for ZstdCodec

Source§

fn clone(&self) -> ZstdCodec

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl CodecTraits for ZstdCodec

Source§

fn identifier(&self) -> &str

Unique identifier for the codec.
Source§

fn configuration_opt( &self, _name: &str, _options: &CodecMetadataOptions, ) -> Option<Configuration>

Create the codec configuration. Read more
Source§

fn partial_decoder_should_cache_input(&self) -> bool

Indicates if the input to a codecs partial decoder should be cached for optimal performance. If true, a cache may be inserted before it in a CodecChain partial decoder.
Source§

fn partial_decoder_decodes_all(&self) -> bool

Indicates if a partial decoder decodes all bytes from its input handle and its output should be cached for optimal performance. If true, a cache will be inserted at some point after it in a CodecChain partial decoder.
Source§

fn default_name(&self) -> String

The default name of the codec.
Source§

fn configuration(&self, name: &str) -> Option<Configuration>

Create the codec configuration with default options. Read more
Source§

impl Debug for ZstdCodec

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.