pub struct LzwDecoder { /* private fields */ }Expand description
Decompresses an LZW stream.
Implementations§
Source§impl LzwDecoder
impl LzwDecoder
Sourcepub fn decode(&self, data: &[u8], limit: usize) -> Result<Vec<u8>>
pub fn decode(&self, data: &[u8], limit: usize) -> Result<Vec<u8>>
Decompress data, refusing to produce more than limit bytes.
The bound is what makes a decompression bomb a malformed-input error rather than an allocation the caller has to survive: LZW expands by up to 4096:1, so a caller states what it is prepared to accept.
§Errors
Returns Error for an invalid code, a stream that ends mid-symbol
without an end code, or output exceeding limit.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for LzwDecoder
impl RefUnwindSafe for LzwDecoder
impl Send for LzwDecoder
impl Sync for LzwDecoder
impl Unpin for LzwDecoder
impl UnsafeUnpin for LzwDecoder
impl UnwindSafe for LzwDecoder
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