Enum fluvio::Compression
source · #[repr(i8)]pub enum Compression {
None = 0,
Gzip = 1,
Snappy = 2,
Lz4 = 3,
Zstd = 4,
}
Expand description
The compression algorithm used to compress and decompress records in fluvio batches
Variants§
Implementations§
source§impl Compression
impl Compression
sourcepub fn compress(&self, src: &[u8]) -> Result<Bytes, CompressionError>
pub fn compress(&self, src: &[u8]) -> Result<Bytes, CompressionError>
Compress the given data, returning the compressed data
sourcepub fn uncompress(
&self,
src: &[u8]
) -> Result<Option<Vec<u8>>, CompressionError>
pub fn uncompress( &self, src: &[u8] ) -> Result<Option<Vec<u8>>, CompressionError>
Uncompresss the given data, returning the uncompressed data if any compression was applied, otherwise returns None
Trait Implementations§
source§impl Clone for Compression
impl Clone for Compression
source§fn clone(&self) -> Compression
fn clone(&self) -> Compression
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for Compression
impl Debug for Compression
source§impl Default for Compression
impl Default for Compression
source§fn default() -> Compression
fn default() -> Compression
Returns the “default value” for a type. Read more
source§impl<'de> Deserialize<'de> for Compression
impl<'de> Deserialize<'de> for Compression
source§fn deserialize<__D>(
__deserializer: __D
) -> Result<Compression, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D
) -> Result<Compression, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl Display for Compression
impl Display for Compression
source§impl FromStr for Compression
impl FromStr for Compression
§type Err = CompressionError
type Err = CompressionError
The associated error which can be returned from parsing.
source§fn from_str(s: &str) -> Result<Compression, <Compression as FromStr>::Err>
fn from_str(s: &str) -> Result<Compression, <Compression as FromStr>::Err>
Parses a string
s
to return a value of this type. Read moresource§impl Hash for Compression
impl Hash for Compression
source§impl PartialEq for Compression
impl PartialEq for Compression
source§fn eq(&self, other: &Compression) -> bool
fn eq(&self, other: &Compression) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl Serialize for Compression
impl Serialize for Compression
source§fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
source§impl TryFrom<i8> for Compression
impl TryFrom<i8> for Compression
§type Error = CompressionError
type Error = CompressionError
The type returned in the event of a conversion error.
source§fn try_from(v: i8) -> Result<Compression, CompressionError>
fn try_from(v: i8) -> Result<Compression, CompressionError>
Performs the conversion.
impl Copy for Compression
impl Eq for Compression
impl StructuralPartialEq for Compression
Auto Trait Implementations§
impl Freeze for Compression
impl RefUnwindSafe for Compression
impl Send for Compression
impl Sync for Compression
impl Unpin for Compression
impl UnwindSafe for Compression
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.