#[non_exhaustive]#[repr(u8)]pub enum CompressionType {
None = 0,
Gzip = 1,
Snappy = 2,
Lz4 = 3,
Zstd = 4,
}Expand description
Codec identifier matching the lowest three bits of Kafka’s record-batch attribute byte.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Implementations§
Source§impl CompressionType
impl CompressionType
Sourcepub fn from_attribute_bits(b: u8) -> Option<Self>
pub fn from_attribute_bits(b: u8) -> Option<Self>
Decode the lowest three bits of a Kafka record-batch attribute byte.
Returns None for codec ids outside 0..=4.
Sourcepub fn as_attribute_bits(self) -> u8
pub fn as_attribute_bits(self) -> u8
Encode this codec into the lowest three bits of an attribute byte.
Trait Implementations§
Source§impl Clone for CompressionType
impl Clone for CompressionType
Source§fn clone(&self) -> CompressionType
fn clone(&self) -> CompressionType
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for CompressionType
Source§impl Debug for CompressionType
impl Debug for CompressionType
impl Eq for CompressionType
Source§impl Hash for CompressionType
impl Hash for CompressionType
Source§impl PartialEq for CompressionType
impl PartialEq for CompressionType
Source§fn eq(&self, other: &CompressionType) -> bool
fn eq(&self, other: &CompressionType) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for CompressionType
Auto Trait Implementations§
impl Freeze for CompressionType
impl RefUnwindSafe for CompressionType
impl Send for CompressionType
impl Sync for CompressionType
impl Unpin for CompressionType
impl UnsafeUnpin for CompressionType
impl UnwindSafe for CompressionType
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