Skip to main content

XzStream

Struct XzStream 

Source
pub struct XzStream { /* private fields */ }
Available on crate feature xz only.
Expand description

Sans-I/O XZ stream decoder.

Implements a buffer-pair API: call process() repeatedly with input/output buffers until Status::StreamEnd is returned.

§Limitations

A block may contain at most one non-LZMA2 filter (a single BCJ or Delta filter) preceding the terminating LZMA2 filter. Streams that chain multiple non-LZMA2 filters in a block are rejected with an error. Use the blocking XzReader to decode those.

Implementations§

Source§

impl XzStream

Source

pub fn new(allow_multiple_streams: bool) -> Self

Create a new XZ stream decoder.

If allow_multiple_streams is true, concatenated XZ streams are decoded sequentially until EOF.

Source

pub fn total_in(&self) -> u64

Total bytes consumed from input across all process() calls.

Source

pub fn total_out(&self) -> u64

Total bytes produced to output across all process() calls.

Source

pub fn check_type(&self) -> Option<CheckType>

The integrity check type used by the current stream.

This is read from the stream header during decoding. Before the header has been parsed, returns CheckType::None.

Source

pub fn process( &mut self, input: &[u8], output: &mut [u8], action: Action, ) -> Result<StreamResult>

Process available data from input into output.

Returns how many bytes were consumed/produced and the stream status. Call repeatedly until Status::StreamEnd is returned.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.