Enum vpb::compression::CompressionAlgorithm
source · [−]#[repr(i32)]
pub enum CompressionAlgorithm {
None,
Snappy,
Zstd,
Lz4,
}
Expand description
CompressionAlgorithm specifies to use which algorithm to compress a block.
Variants
None
None mode indicates that a block is not compressed.
Snappy
Snappy mode indicates that a block is compressed using Snappy algorithm.
Zstd
ZSTD mode indicates that a block is compressed using ZSTD algorithm. ZSTD,
Lz4
Lz4 mode indicates that a block is compressed using lz4 algorithm.
Implementations
sourceimpl CompressionAlgorithm
impl CompressionAlgorithm
sourcepub const fn as_str_name(&self) -> &'static str
pub const fn as_str_name(&self) -> &'static str
String value of the enum field names used in the ProtoBuf definition.
The values are not transformed in any way and thus are considered stable (if the ProtoBuf definition does not change) and safe for programmatic use.
Trait Implementations
sourceimpl Clone for CompressionAlgorithm
impl Clone for CompressionAlgorithm
sourcefn clone(&self) -> CompressionAlgorithm
fn clone(&self) -> CompressionAlgorithm
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 CompressionAlgorithm
impl Debug for CompressionAlgorithm
sourceimpl Default for CompressionAlgorithm
impl Default for CompressionAlgorithm
sourcefn default() -> CompressionAlgorithm
fn default() -> CompressionAlgorithm
Returns the “default value” for a type. Read more
sourceimpl From<CompressionAlgorithm> for i32
impl From<CompressionAlgorithm> for i32
sourcefn from(value: CompressionAlgorithm) -> i32
fn from(value: CompressionAlgorithm) -> i32
Converts to this type from the input type.
sourceimpl From<i128> for CompressionAlgorithm
impl From<i128> for CompressionAlgorithm
sourcefn from(val: i128) -> CompressionAlgorithm
fn from(val: i128) -> CompressionAlgorithm
Converts to this type from the input type.
sourceimpl From<i16> for CompressionAlgorithm
impl From<i16> for CompressionAlgorithm
sourcefn from(val: i16) -> CompressionAlgorithm
fn from(val: i16) -> CompressionAlgorithm
Converts to this type from the input type.
sourceimpl From<i32> for CompressionAlgorithm
impl From<i32> for CompressionAlgorithm
sourcefn from(val: i32) -> CompressionAlgorithm
fn from(val: i32) -> CompressionAlgorithm
Converts to this type from the input type.
sourceimpl From<i64> for CompressionAlgorithm
impl From<i64> for CompressionAlgorithm
sourcefn from(val: i64) -> CompressionAlgorithm
fn from(val: i64) -> CompressionAlgorithm
Converts to this type from the input type.
sourceimpl From<i8> for CompressionAlgorithm
impl From<i8> for CompressionAlgorithm
sourcefn from(val: i8) -> CompressionAlgorithm
fn from(val: i8) -> CompressionAlgorithm
Converts to this type from the input type.
sourceimpl From<isize> for CompressionAlgorithm
impl From<isize> for CompressionAlgorithm
sourcefn from(val: isize) -> CompressionAlgorithm
fn from(val: isize) -> CompressionAlgorithm
Converts to this type from the input type.
sourceimpl From<u128> for CompressionAlgorithm
impl From<u128> for CompressionAlgorithm
sourcefn from(val: u128) -> CompressionAlgorithm
fn from(val: u128) -> CompressionAlgorithm
Converts to this type from the input type.
sourceimpl From<u16> for CompressionAlgorithm
impl From<u16> for CompressionAlgorithm
sourcefn from(val: u16) -> CompressionAlgorithm
fn from(val: u16) -> CompressionAlgorithm
Converts to this type from the input type.
sourceimpl From<u32> for CompressionAlgorithm
impl From<u32> for CompressionAlgorithm
sourcefn from(val: u32) -> CompressionAlgorithm
fn from(val: u32) -> CompressionAlgorithm
Converts to this type from the input type.
sourceimpl From<u64> for CompressionAlgorithm
impl From<u64> for CompressionAlgorithm
sourcefn from(val: u64) -> CompressionAlgorithm
fn from(val: u64) -> CompressionAlgorithm
Converts to this type from the input type.
sourceimpl From<u8> for CompressionAlgorithm
impl From<u8> for CompressionAlgorithm
sourcefn from(val: u8) -> CompressionAlgorithm
fn from(val: u8) -> CompressionAlgorithm
Converts to this type from the input type.
sourceimpl From<usize> for CompressionAlgorithm
impl From<usize> for CompressionAlgorithm
sourcefn from(val: usize) -> CompressionAlgorithm
fn from(val: usize) -> CompressionAlgorithm
Converts to this type from the input type.
sourceimpl Hash for CompressionAlgorithm
impl Hash for CompressionAlgorithm
sourceimpl Ord for CompressionAlgorithm
impl Ord for CompressionAlgorithm
sourcefn cmp(&self, other: &CompressionAlgorithm) -> Ordering
fn cmp(&self, other: &CompressionAlgorithm) -> Ordering
1.21.0 · sourcefn max(self, other: Self) -> Self
fn max(self, other: Self) -> Self
Compares and returns the maximum of two values. Read more
1.21.0 · sourcefn min(self, other: Self) -> Self
fn min(self, other: Self) -> Self
Compares and returns the minimum of two values. Read more
1.50.0 · sourcefn clamp(self, min: Self, max: Self) -> Selfwhere
Self: PartialOrd<Self>,
fn clamp(self, min: Self, max: Self) -> Selfwhere
Self: PartialOrd<Self>,
Restrict a value to a certain interval. Read more
sourceimpl PartialEq<CompressionAlgorithm> for CompressionAlgorithm
impl PartialEq<CompressionAlgorithm> for CompressionAlgorithm
sourcefn eq(&self, other: &CompressionAlgorithm) -> bool
fn eq(&self, other: &CompressionAlgorithm) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourceimpl PartialOrd<CompressionAlgorithm> for CompressionAlgorithm
impl PartialOrd<CompressionAlgorithm> for CompressionAlgorithm
sourcefn partial_cmp(&self, other: &CompressionAlgorithm) -> Option<Ordering>
fn partial_cmp(&self, other: &CompressionAlgorithm) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
impl Copy for CompressionAlgorithm
impl Eq for CompressionAlgorithm
impl StructuralEq for CompressionAlgorithm
impl StructuralPartialEq for CompressionAlgorithm
Auto Trait Implementations
impl RefUnwindSafe for CompressionAlgorithm
impl Send for CompressionAlgorithm
impl Sync for CompressionAlgorithm
impl Unpin for CompressionAlgorithm
impl UnwindSafe for CompressionAlgorithm
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
sourceimpl<T> Checksumer for T
impl<T> Checksumer for T
sourcefn checksum(&self, algorithm: ChecksumAlgorithm) -> Checksumwhere
Self: AsRef<[u8]>,
fn checksum(&self, algorithm: ChecksumAlgorithm) -> Checksumwhere
Self: AsRef<[u8]>,
Calculates checksum of data
.
sourcefn verify_checksum(&self, expected: u64, algo: ChecksumAlgorithm) -> boolwhere
Self: AsRef<[u8]>,
fn verify_checksum(&self, expected: u64, algo: ChecksumAlgorithm) -> boolwhere
Self: AsRef<[u8]>,
Validates the checksum for the data against the given expected checksum. Return true
if the checksum is valid.
sourceimpl<T> Compressor for T
impl<T> Compressor for T
fn compress_to(&self, dst: &mut [u8], cmp: Compression) -> Result<usize, Error>where
Self: AsRef<[u8]>,
fn compress_into_vec(&self, cmp: Compression) -> Result<Vec<u8>, Error>where
Self: AsRef<[u8]>,
fn decompress_to(&self, dst: &mut [u8], cmp: Compression) -> Result<usize, Error>where
Self: AsRef<[u8]>,
fn decompress_into_vec(&self, cmp: Compression) -> Result<Vec<u8>, Error>where
Self: AsRef<[u8]>,
fn max_encoded_len(&self, cmp: Compression) -> usizewhere
Self: AsRef<[u8]>,
sourceimpl<T> Encryptor for T
impl<T> Encryptor for T
sourcefn encrypt(
&mut self,
key: &[u8],
iv: &[u8],
algo: EncryptionAlgorithm
) -> Result<(), EncryptError>where
Self: AsMut<[u8]>,
fn encrypt(
&mut self,
key: &[u8],
iv: &[u8],
algo: EncryptionAlgorithm
) -> Result<(), EncryptError>where
Self: AsMut<[u8]>,
Encrypts self with IV. Can be used for both encryption and decryption. Read more
sourcefn encrypt_to_vec(
&self,
key: &[u8],
iv: &[u8],
algo: EncryptionAlgorithm
) -> Result<Vec<u8>, EncryptError>where
Self: AsRef<[u8]>,
fn encrypt_to_vec(
&self,
key: &[u8],
iv: &[u8],
algo: EncryptionAlgorithm
) -> Result<Vec<u8>, EncryptError>where
Self: AsRef<[u8]>,
Encrypts self with IV to a new Vec
.
Can be used for both encryption and decryption. Read more
sourcefn encrypt_to(
&self,
dst: &mut [u8],
key: &[u8],
iv: &[u8],
algo: EncryptionAlgorithm
) -> Result<(), EncryptError>where
Self: AsRef<[u8]>,
fn encrypt_to(
&self,
dst: &mut [u8],
key: &[u8],
iv: &[u8],
algo: EncryptionAlgorithm
) -> Result<(), EncryptError>where
Self: AsRef<[u8]>,
Encrypts self with IV to dst
.
Can be used for both encryption and decryption. Read more