[−][src]Struct async_tar::Archive
A top-level representation of an archive file.
This archive can have an entry added to it and it can be iterated over.
Methods
impl<R: Read + Unpin + Sync + Send> Archive<R>
[src]
pub fn new(obj: R) -> Archive<R>
[src]
Create a new archive with the underlying object as the reader.
pub fn into_inner(self) -> Result<R, Self>
[src]
Unwrap this archive, returning the underlying object.
pub fn entries(&mut self) -> Result<Entries<R>>
[src]
Construct an stream over the entries in this archive.
Note that care must be taken to consider each entry within an archive in sequence. If entries are processed out of sequence (from what the stream returns), then the contents read for each entry may be corrupted.
pub fn entries_raw(&mut self) -> Result<RawEntries<R>>
[src]
Construct an stream over the raw entries in this archive.
Note that care must be taken to consider each entry within an archive in sequence. If entries are processed out of sequence (from what the stream returns), then the contents read for each entry may be corrupted.
pub async fn unpack<'_, P: AsRef<Path>>(&'_ mut self, dst: P) -> Result<()>
[src]
Unpacks the contents tarball into the specified dst
.
This function will iterate over the entire contents of this tarball, extracting each file in turn to the location specified by the entry's path name.
This operation is relatively sensitive in that it will not write files
outside of the path specified by dst
. Files in the archive which have
a '..' in their path are skipped during the unpacking process.
Examples
use async_std::fs::File; use async_tar::Archive; let mut ar = Archive::new(File::open("foo.tar").await?); ar.unpack("foo").await?;
Trait Implementations
impl<R: Read + Unpin> AsyncRead for Archive<R>
[src]
fn poll_read(
self: Pin<&mut Self>,
cx: &mut Context,
into: &mut [u8]
) -> Poll<Result<usize>>
[src]
self: Pin<&mut Self>,
cx: &mut Context,
into: &mut [u8]
) -> Poll<Result<usize>>
fn poll_read_vectored(
self: Pin<&mut Self>,
cx: &mut Context,
bufs: &mut [IoSliceMut]
) -> Poll<Result<usize, Error>>
[src]
self: Pin<&mut Self>,
cx: &mut Context,
bufs: &mut [IoSliceMut]
) -> Poll<Result<usize, Error>>
impl<R: Read + Unpin> Clone for Archive<R>
[src]
fn clone(&self) -> Self
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl<R: Debug + Read + Unpin> Debug for Archive<R>
[src]
Auto Trait Implementations
impl<R> !RefUnwindSafe for Archive<R>
impl<R> !Send for Archive<R>
impl<R> !Sync for Archive<R>
impl<R> Unpin for Archive<R>
impl<R> !UnwindSafe for Archive<R>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ReadExt for T where
T: AsyncRead + ?Sized,
[src]
T: AsyncRead + ?Sized,
fn read(&'a mut self, buf: &'a mut [u8]) -> ReadFuture<'a, Self> where
Self: Unpin,
[src]
Self: Unpin,
fn read_vectored(
&'a mut self,
bufs: &'a mut [IoSliceMut<'a>]
) -> ReadVectoredFuture<'a, Self> where
Self: Unpin,
[src]
&'a mut self,
bufs: &'a mut [IoSliceMut<'a>]
) -> ReadVectoredFuture<'a, Self> where
Self: Unpin,
fn read_to_end(&'a mut self, buf: &'a mut Vec<u8>) -> ReadToEndFuture<'a, Self> where
Self: Unpin,
[src]
Self: Unpin,
fn read_to_string(
&'a mut self,
buf: &'a mut String
) -> ReadToStringFuture<'a, Self> where
Self: Unpin,
[src]
&'a mut self,
buf: &'a mut String
) -> ReadToStringFuture<'a, Self> where
Self: Unpin,
fn read_exact(&'a mut self, buf: &'a mut [u8]) -> ReadExactFuture<'a, Self> where
Self: Unpin,
[src]
Self: Unpin,
fn take(self, limit: u64) -> Take<Self>
[src]
fn by_ref(&mut self) -> &mut Self
[src]
fn bytes(self) -> Bytes<Self>
[src]
fn chain<R>(self, next: R) -> Chain<Self, R> where
R: AsyncRead,
[src]
R: AsyncRead,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,