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 with_policy(self, policy: StreamPolicy) -> Self
pub fn with_policy(self, policy: StreamPolicy) -> Self
Configures the framing policy used by this reader.
Call before reading any members.
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.