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<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
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 · sourceconst fn clone_from(&mut self, source: &Self)
const fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moresourceimpl 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 Display for Compression
impl Display for Compression
sourceimpl FromStr for Compression
impl FromStr for Compression
sourceimpl PartialEq<Compression> for Compression
impl PartialEq<Compression> for Compression
sourcefn eq(&self, other: &Compression) -> bool
fn eq(&self, other: &Compression) -> bool
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 Eq for Compression
impl StructuralEq 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 Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
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