pub struct TarArchive<R> { /* private fields */ }Expand description
This type reads one structurally valid pax or GNU tar archive in one pass.
Member paths and link targets are not normalized for extraction. A direct consumer must validate them before it uses them as file-system paths.
By default, member iteration validates final record padding and waits for
EOF before reporting the end of the archive. See DecodePolicy::trailing_data_policy.
After a member or payload read returns an error, subsequent reads return
DecodeError::Poisoned. At the end of the archive, member iteration
returns Ok(None). Cancelled reads can be retried.
ArchiveTrait::extract_in validates member paths and link targets
during extraction.
Implementations§
Source§impl<R> TarArchive<R>
impl<R> TarArchive<R>
Sourcepub fn with_policy(self, policy: DecodePolicy) -> Self
pub fn with_policy(self, policy: DecodePolicy) -> Self
Configures the decoding policy used by this archive.
Call before reading any members.
Trait Implementations§
Source§impl<R: AsyncRead + Unpin> Archive for TarArchive<R>
impl<R: AsyncRead + Unpin> Archive for TarArchive<R>
Source§type Error = DecodeError
type Error = DecodeError
The archive-format error returned during member iteration.
Source§type Payload<'a> = TarMemberPayload<'a, R>where
Self: 'a,
type Payload<'a> = TarMemberPayload<'a, R>where
Self: 'a,
The streaming payload type lent by each file member.
Source§async fn next_member<'a>(
&'a mut self,
) -> Result<Option<Member<Self::Payload<'a>>>, Self::Error>
async fn next_member<'a>( &'a mut self, ) -> Result<Option<Member<Self::Payload<'a>>>, Self::Error>
Reads the next format-neutral member for
Members::next. Read moreSource§fn members(self) -> Members<Self>
fn members(self) -> Members<Self>
Consumes this archive and returns its lending member cursor. Read more
Source§async fn extract_in<P>(
self,
destination: P,
policy: ExtractPolicy,
) -> Result<(), ExtractError<Self::Error>>
async fn extract_in<P>( self, destination: P, policy: ExtractPolicy, ) -> Result<(), ExtractError<Self::Error>>
Auto Trait Implementations§
impl<R> Forget for TarArchive<R>
impl<R> Freeze for TarArchive<R>
impl<R> Move for TarArchive<R>
impl<R> RefUnwindSafe for TarArchive<R>where
TarReader<R>: RefUnwindSafe,
impl<R> Send for TarArchive<R>
impl<R> Sync for TarArchive<R>
impl<R> Unpin for TarArchive<R>
impl<R> UnsafeUnpin for TarArchive<R>where
TarReader<R>: UnsafeUnpin,
impl<R> UnwindSafe for TarArchive<R>where
TarReader<R>: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more