Skip to main content

TarStream

Struct TarStream 

Source
pub struct TarStream<R> { /* private fields */ }
Expand description

A strict stream of POSIX-pax or GNU frames sourced from an underlying reader.

Implementations§

Source§

impl<R> TarStream<R>

Source

pub fn new(reader: R) -> Self

Creates a new TarStream from the given reader.

Source

pub fn set_max_pax_extension_size(&mut self, max_pax_extension_size: u64)

Sets the maximum size accepted for each subsequent pax extension.

A local or global header that declares a larger payload is rejected before its payload is consumed. Setting the maximum to zero rejects every nonempty extension. Setting it to u64::MAX removes the per-extension bound; global extensions remain subject to their cumulative limit.

Source

pub fn set_max_global_pax_extensions_size( &mut self, max_global_pax_extensions_size: u64, )

Sets the maximum cumulative size accepted for global pax extensions before one ordinary member.

The total resets after each ordinary member. A global header that would increase the pending total beyond this limit is rejected before its payload is consumed. Setting the maximum to zero rejects every nonempty global extension. Setting it to u64::MAX removes the cumulative bound; each extension remains subject to its individual limit.

Source

pub fn set_allow_all_nul_numeric_fields(&mut self, allow: bool)

Sets whether wholly NUL numeric metadata fields may be accepted.

This compatibility option applies to mode, uid, gid, and mtime in both pax/ustar and GNU ordinary member headers. It is enabled by default. Disabling it requires each field to use a valid numeric encoding for its archive family.

Source

pub fn set_max_gnu_extension_size(&mut self, max_gnu_extension_size: u64)

Sets the maximum size accepted for each GNU extension.

A GNU extension member that declares a larger payload is rejected before its payload is consumed. Setting the maximum to zero rejects every nonempty GNU extension member. Setting it to u64::MAX removes the per-extension bound.

Source

pub fn format(&self) -> Option<ArchiveFormat>

Returns the selected archive family after the first header is read.

Source§

impl<R: AsyncRead + Unpin> TarStream<R>

Source

pub async fn next_frame(&mut self) -> Result<Option<Frame>, FrameError>

Returns the next non-terminator physical archive frame.

Reaching the end of the archive returns None. A framing error fuses this reader, so every subsequent call also returns None. Cancelling this operation retains any partial block for the next call.

Auto Trait Implementations§

§

impl<R> Freeze for TarStream<R>
where R: Freeze,

§

impl<R> RefUnwindSafe for TarStream<R>
where R: RefUnwindSafe,

§

impl<R> Send for TarStream<R>
where R: Send,

§

impl<R> Sync for TarStream<R>
where R: Sync,

§

impl<R> Unpin for TarStream<R>
where R: Unpin,

§

impl<R> UnsafeUnpin for TarStream<R>
where R: UnsafeUnpin,

§

impl<R> UnwindSafe for TarStream<R>
where R: UnwindSafe,

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, 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.