[][src]Struct ar::Archive

pub struct Archive<R: Read> { /* fields omitted */ }

A structure for reading archives.

Methods

impl<R: Read> Archive<R>[src]

pub fn new(reader: R) -> Archive<R>[src]

Create a new archive reader with the underlying reader object as the source of all data read.

pub fn variant(&self) -> Variant[src]

Returns which format variant this archive appears to be so far.

Note that this may not be accurate before the archive has been fully read (i.e. before the next_entry() method returns None). In particular, a new Archive object that hasn't yet read any data at all will always return Variant::Common.

pub fn into_inner(self) -> Result<R>[src]

Unwrap this archive reader, returning the underlying reader object.

pub fn next_entry(&mut self) -> Option<Result<Entry<R>>>[src]

Reads the next entry from the archive, or returns None if there are no more.

impl<R: Read + Seek> Archive<R>[src]

pub fn count_entries(&mut self) -> Result<usize>[src]

Scans the archive and returns the total number of entries in the archive (not counting special entries, such as the GNU archive name table or symbol table, that are not returned by next_entry()).

pub fn jump_to_entry(&mut self, index: usize) -> Result<Entry<R>>[src]

Scans the archive and jumps to the entry at the given index. Returns an error if the index is not less than the result of count_entries().

pub fn symbols(&mut self) -> Result<Symbols<R>>[src]

Scans the archive and returns an iterator over the symbols in the archive's symbol table. If the archive doesn't have a symbol table, this method will still succeed, but the iterator won't produce any values.

Auto Trait Implementations

impl<R> Send for Archive<R> where
    R: Send

impl<R> Unpin for Archive<R> where
    R: Unpin

impl<R> Sync for Archive<R> where
    R: Sync

impl<R> UnwindSafe for Archive<R> where
    R: UnwindSafe

impl<R> RefUnwindSafe for Archive<R> where
    R: RefUnwindSafe

Blanket Implementations

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]