pub struct ZstdCodec { /* private fields */ }
Available on crate feature
zstd
only.Expand description
A zstd
codec implementation.
Implementations§
Source§impl ZstdCodec
impl ZstdCodec
Sourcepub const fn new(compression: CompressionLevel, checksum: bool) -> Self
pub const fn new(compression: CompressionLevel, checksum: bool) -> Self
Create a new Zstd
codec.
Sourcepub fn new_with_configuration(
configuration: &ZstdCodecConfiguration,
) -> Result<Self, PluginCreateError>
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
impl BytesToBytesCodecTraits for ZstdCodec
Source§fn into_dyn(self: Arc<Self>) -> Arc<dyn BytesToBytesCodecTraits>
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>
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>
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>
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
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>
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>
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>>
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>>
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>>
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>>
Available on crate feature
async
only.Initialise an asynchronous partial encoder. Read more
Source§impl CodecTraits for ZstdCodec
impl CodecTraits for ZstdCodec
Source§fn identifier(&self) -> &str
fn identifier(&self) -> &str
Unique identifier for the codec.
Source§fn configuration_opt(
&self,
_name: &str,
_options: &CodecMetadataOptions,
) -> Option<Configuration>
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
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
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
fn default_name(&self) -> String
The default name of the codec.
Source§fn configuration(&self, name: &str) -> Option<Configuration>
fn configuration(&self, name: &str) -> Option<Configuration>
Create the codec configuration with default options. Read more
Auto Trait Implementations§
impl Freeze for ZstdCodec
impl RefUnwindSafe for ZstdCodec
impl Send for ZstdCodec
impl Sync for ZstdCodec
impl Unpin for ZstdCodec
impl UnwindSafe for ZstdCodec
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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