Enum fluvio_compression::Compression
source · [−]#[repr(i8)]
pub enum Compression {
None,
Gzip,
Snappy,
Lz4,
}Expand description
The compression algorithm used to compress and decompress records in fluvio batches
Variants
None
Gzip
Snappy
Lz4
Implementations
sourceimpl Compression
impl Compression
sourcepub fn compress(&self, src: &[u8]) -> Result<Vec<u8>, CompressionError>
pub fn compress(&self, src: &[u8]) -> Result<Vec<u8>, 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
sourceimpl Clone for Compression
impl Clone for Compression
sourcefn clone(&self) -> Compression
fn clone(&self) -> Compression
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read more
sourceimpl Debug for Compression
impl Debug for Compression
sourceimpl Default for Compression
impl Default for Compression
sourceimpl<'de> Deserialize<'de> for Compression
impl<'de> Deserialize<'de> for Compression
sourcefn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
sourceimpl FromStr for Compression
impl FromStr for Compression
sourceimpl PartialEq<Compression> for Compression
impl PartialEq<Compression> for Compression
sourceimpl Serialize for Compression
impl Serialize for Compression
sourceimpl 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.
sourcefn try_from(v: i8) -> Result<Self, CompressionError>
fn try_from(v: i8) -> Result<Self, CompressionError>
Performs the conversion.
impl Copy for Compression
impl StructuralPartialEq for Compression
Auto Trait Implementations
impl RefUnwindSafe for Compression
impl Send for Compression
impl Sync for Compression
impl Unpin for Compression
impl UnwindSafe for Compression
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
🔬 This is a nightly-only experimental API. (
toowned_clone_into)Uses borrowed data to replace owned data, usually by cloning. Read more