[][src]Enum asuran::repository::Compression

pub enum Compression {
    NoCompression,
    ZStd {
        level: i32,
    },
    LZ4 {
        level: u32,
    },
    LZMA {
        level: u32,
    },
}

Marker for the type of compression used by a particular chunk

Variants

NoCompression
ZStd

Fields of ZStd

level: i32
LZ4

Fields of LZ4

level: u32
LZMA

Fields of LZMA

level: u32

Methods

impl Compression[src]

pub fn compress(self, data: Vec<u8>) -> Vec<u8>[src]

Compresses the data with the algorithm indicated and level by the variant of self

Panics

Will panic if the user selects a compression algorithm for which support has not been compiled in, or if compression otherwise fails.

pub fn decompress(self, data: Vec<u8>) -> Result<Vec<u8>, CompressionError>[src]

Decompresses the given data with the algorithm specified by the variant of self

Errors

Will return Err if decompression fails.

Panics

Will panic if the user selects a compression algorithm for which support has not been compiled in.

Trait Implementations

impl Clone for Compression[src]

impl Copy for Compression[src]

impl Debug for Compression[src]

impl<'de> Deserialize<'de> for Compression[src]

impl Eq for Compression[src]

impl Hash for Compression[src]

impl PartialEq<Compression> for Compression[src]

impl Serialize for Compression[src]

impl StructuralEq for Compression[src]

impl StructuralPartialEq for Compression[src]

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

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> DeserializeOwned for T where
    T: Deserialize<'de>, 
[src]

impl<Q, K> Equivalent<K> for Q where
    K: Borrow<Q> + ?Sized,
    Q: Eq + ?Sized
[src]

impl<T> From<T> for T[src]

impl<T> Instrument for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>, 

impl<T> WithSubscriber for T[src]