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>
impl<R> TarReader<R>
Sourcepub fn set_max_pax_extension_size(&mut self, max_pax_extension_size: u64)
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.
Sourcepub fn set_max_global_pax_extensions_size(
&mut self,
max_global_pax_extensions_size: u64,
)
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.
Sourcepub fn set_allow_all_nul_numeric_fields(&mut self, allow: bool)
pub fn set_allow_all_nul_numeric_fields(&mut self, allow: bool)
Sets whether wholly NUL numeric metadata fields may be accepted.
Sourcepub fn set_max_gnu_extension_size(&mut self, max_gnu_extension_size: u64)
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>
impl<R: AsyncRead + Unpin> TarReader<R>
Sourcepub async fn next_frame(
&mut self,
) -> Result<Option<MemberFrame<'_, R>>, FrameError>
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.