Enum cdrs::compression::Compression
[−]
[src]
pub enum Compression { Lz4, Snappy, None, }
Enum which represents a type of compression. Only non-startup frame's body can be compressen.
Variants
Lz4
lz4 compression
Snappy
snappy compression
None
Non compression
Methods
impl Compression
[src]
fn encode(&self, bytes: Vec<u8>) -> Result<Vec<u8>, CompressionError>
It encodes bytes
basing on type of compression.
fn decode(&self, bytes: Vec<u8>) -> Result<Vec<u8>, CompressionError>
It decodes bytes
basing on type of compression.
fn into_string(&self) -> Option<String>
It transforms compression method into a string.
Trait Implementations
impl Debug for Compression
[src]
impl PartialEq for Compression
[src]
fn eq(&self, __arg_0: &Compression) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &Rhs) -> bool
1.0.0
This method tests for !=
.
impl Clone for Compression
[src]
fn clone(&self) -> Compression
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more
impl Copy for Compression
[src]
impl From<String> for Compression
[src]
fn from(compression_string: String) -> Compression
It converts String
into Compression
. If string is neither lz4
nor snappy
then
Compression::None
will be returned
impl<'a> From<&'a str> for Compression
[src]
fn from(compression_str: &'a str) -> Compression
It converts str
into Compression
. If string is neither lz4
nor snappy
then
Compression::None
will be returned