Skip to main content

TarReader

Struct TarReader 

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

A logical reader that assembles physical frames into archive-level items.

Unlike TarStream, this API attaches PAX or GNU extension metadata to the ordinary member it describes. Each PAX member carries one PaxState with effective metadata and newly encountered positioned extensions. Ordinary header path and link-path fallbacks are copied into reusable storage and borrowed by the returned Header.

Implementations§

Source§

impl<R> TarReader<R>

Source

pub fn new(reader: R) -> Self

Creates a new logical reader from an uncompressed tar 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 pax header that declares a larger payload is rejected before any of its payload blocks are consumed. Setting the maximum to u64::MAX removes the per-extension bound; global extensions remain subject to their cumulative limit.

See TarStream::set_max_pax_extension_size.

Source

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

Sets the maximum cumulative size of global pax extensions before one member.

A global header that would increase the pending total beyond this limit is rejected before its payload is consumed. Setting the maximum to u64::MAX removes the cumulative bound; each extension remains subject to its individual limit.

See TarStream::set_max_global_pax_extensions_size.

Source

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

Sets whether wholly NUL numeric metadata fields may be accepted.

See TarStream::set_allow_all_nul_numeric_fields.

Source

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

Sets the maximum size accepted for each subsequent GNU metadata extension.

A long-name or long-link header that declares a larger payload is rejected before any of its payload blocks are consumed. Setting the maximum to u64::MAX permits unbounded metadata buffering.

Source§

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

Source

pub async fn next_frame( &mut self, ) -> Result<Option<MemberFrame<'_, R>>, FrameError>

Returns the next ordinary archive member.

If the preceding member payload was not fully consumed, it is first drained and validated. Extension metadata is then consumed and attached before the next member is returned. Global pax updates not followed by an ordinary member are consumed and ignored. A returned pax state is a view borrowing this reader; it must be dropped before requesting another member.

Auto Trait Implementations§

§

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

§

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

§

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

§

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

§

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

§

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

§

impl<R> UnwindSafe for TarReader<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.