Enum libflate::zlib::Lz77WindowSize
source · pub enum Lz77WindowSize {
B256,
B512,
KB1,
KB2,
KB4,
KB8,
KB16,
KB32,
}
Expand description
LZ77 Window sizes defined by the ZLIB format.
Variants§
B256
256 bytes
B512
512 btyes
KB1
1 kilobyte
KB2
2 kilobytes
KB4
4 kitobytes
KB8
8 kitobytes
KB16
16 kitobytes
KB32
32 kitobytes
Implementations§
source§impl Lz77WindowSize
impl Lz77WindowSize
fn from_u4(compression_info: u8) -> Option<Self>
fn as_u4(&self) -> u8
sourcepub fn from_u16(size: u16) -> Self
pub fn from_u16(size: u16) -> Self
Converts from u16
to Lz77WindowSize`.
Fractions are rounded to next upper window size.
If size
exceeds maximum window size,
lz77::MAX_WINDOW_SIZE
will be used instead.
Examples
use libflate::zlib::Lz77WindowSize;
assert_eq!(Lz77WindowSize::from_u16(15000), Lz77WindowSize::KB16);
assert_eq!(Lz77WindowSize::from_u16(16384), Lz77WindowSize::KB16);
assert_eq!(Lz77WindowSize::from_u16(16385), Lz77WindowSize::KB32);
assert_eq!(Lz77WindowSize::from_u16(40000), Lz77WindowSize::KB32);
Trait Implementations§
source§impl Clone for Lz77WindowSize
impl Clone for Lz77WindowSize
source§fn clone(&self) -> Lz77WindowSize
fn clone(&self) -> Lz77WindowSize
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for Lz77WindowSize
impl Debug for Lz77WindowSize
source§impl Hash for Lz77WindowSize
impl Hash for Lz77WindowSize
source§impl Ord for Lz77WindowSize
impl Ord for Lz77WindowSize
source§fn cmp(&self, other: &Lz77WindowSize) -> Ordering
fn cmp(&self, other: &Lz77WindowSize) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere Self: Sized,
Compares and returns the maximum of two values. Read more
source§impl PartialEq<Lz77WindowSize> for Lz77WindowSize
impl PartialEq<Lz77WindowSize> for Lz77WindowSize
source§fn eq(&self, other: &Lz77WindowSize) -> bool
fn eq(&self, other: &Lz77WindowSize) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl PartialOrd<Lz77WindowSize> for Lz77WindowSize
impl PartialOrd<Lz77WindowSize> for Lz77WindowSize
source§fn partial_cmp(&self, other: &Lz77WindowSize) -> Option<Ordering>
fn partial_cmp(&self, other: &Lz77WindowSize) -> Option<Ordering>
1.0.0 · source§fn 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 moreimpl Eq for Lz77WindowSize
impl StructuralEq for Lz77WindowSize
impl StructuralPartialEq for Lz77WindowSize
Auto Trait Implementations§
impl RefUnwindSafe for Lz77WindowSize
impl Send for Lz77WindowSize
impl Sync for Lz77WindowSize
impl Unpin for Lz77WindowSize
impl UnwindSafe for Lz77WindowSize
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