pub enum Compression {
UNCOMPRESSED,
SNAPPY,
GZIP(GzipLevel),
LZO,
BROTLI(BrotliLevel),
LZ4,
ZSTD(ZstdLevel),
LZ4_RAW,
}Expand description
Supported block compression algorithms.
Block compression can yield non-trivial improvements to storage efficiency at the expense of potentially significantly worse encode and decode performance. Many applications, especially those making use of high-throughput and low-cost commodity object storage, may find storage efficiency less important than decode throughput, and therefore may wish to not make use of block compression.
The writers in this crate default to no block compression for this reason.
Applications that do still wish to use block compression, will find Compression::ZSTD
to provide a good balance of compression, performance, and ecosystem support. Alternatively,
Compression::LZ4_RAW provides much faster decompression speeds, at the cost of typically
worse compression ratios. However, it is not as widely supported by the ecosystem, with the
Hadoop ecosystem historically favoring the non-standard and now deprecated Compression::LZ4.
Variants§
UNCOMPRESSED
No compression.
SNAPPY
GZIP(GzipLevel)
LZO
BROTLI(BrotliLevel)
LZ4
ZSTD(ZstdLevel)
LZ4_RAW
Implementations§
Source§impl Compression
impl Compression
Sourcepub(crate) fn codec_to_string(self) -> String
pub(crate) fn codec_to_string(self) -> String
Returns the codec type of this compression setting as a string, without the compression level.
Trait Implementations§
Source§impl Clone for Compression
impl Clone for Compression
Source§fn clone(&self) -> Compression
fn clone(&self) -> Compression
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for Compression
impl Debug for Compression
Source§impl Display for Compression
impl Display for Compression
Source§impl FromStr for Compression
impl FromStr for Compression
Source§impl HeapSize for Compression
impl HeapSize for Compression
Source§impl PartialEq for Compression
impl PartialEq for Compression
Source§impl<'a, R: ThriftCompactInputProtocol<'a>> ReadThrift<'a, R> for Compression
impl<'a, R: ThriftCompactInputProtocol<'a>> ReadThrift<'a, R> for Compression
Source§fn read_thrift(prot: &mut R) -> Result<Self>
fn read_thrift(prot: &mut R) -> Result<Self>
Self from the input protocol object.Source§impl WriteThrift for Compression
impl WriteThrift for Compression
Source§const ELEMENT_TYPE: ElementType = ElementType::I32
const ELEMENT_TYPE: ElementType = ElementType::I32
ElementType to use when a list of this object is written.Source§fn write_thrift<W: Write>(
&self,
writer: &mut ThriftCompactOutputProtocol<W>,
) -> Result<()>
fn write_thrift<W: Write>( &self, writer: &mut ThriftCompactOutputProtocol<W>, ) -> Result<()>
writer.Source§impl WriteThriftField for Compression
impl WriteThriftField for Compression
Source§fn write_thrift_field<W: Write>(
&self,
writer: &mut ThriftCompactOutputProtocol<W>,
field_id: i16,
last_field_id: i16,
) -> Result<i16>
fn write_thrift_field<W: Write>( &self, writer: &mut ThriftCompactOutputProtocol<W>, field_id: i16, last_field_id: i16, ) -> Result<i16>
field_id, using last_field_id to compute the
field delta used by the Thrift compact protocol. On success this will return field_id
to be used in chaining.impl Copy for Compression
impl Eq for Compression
impl StructuralPartialEq for Compression
Auto Trait Implementations§
impl Freeze for Compression
impl RefUnwindSafe for Compression
impl Send for Compression
impl Sync for Compression
impl Unpin for Compression
impl UnwindSafe for Compression
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more