[][src]Struct ar::GnuBuilder

pub struct GnuBuilder<W: Write> { /* fields omitted */ }

A structure for building GNU-variant archives (the archive format typically used on e.g. GNU/Linux and Windows systems).

This structure has methods for building up an archive from scratch into any arbitrary writer.

Methods

impl<W: Write> GnuBuilder<W>[src]

pub fn new(writer: W, identifiers: Vec<Vec<u8>>) -> GnuBuilder<W>[src]

Create a new archive builder with the underlying writer object as the destination of all data written. The identifiers parameter must give the complete list of entry identifiers that will be included in this archive.

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

Unwrap this archive builder, returning the underlying writer object.

pub fn append<R: Read>(&mut self, header: &Header, data: R) -> Result<()>[src]

Adds a new entry to this archive.

pub fn append_path<P: AsRef<Path>>(&mut self, path: P) -> Result<()>[src]

Adds a file on the local filesystem to this archive, using the file name as its identifier.

pub fn append_file(&mut self, name: &[u8], file: &mut File) -> Result<()>[src]

Adds a file to this archive, with the given name as its identifier.

Auto Trait Implementations

impl<W> Send for GnuBuilder<W> where
    W: Send

impl<W> Unpin for GnuBuilder<W> where
    W: Unpin

impl<W> Sync for GnuBuilder<W> where
    W: Sync

impl<W> UnwindSafe for GnuBuilder<W> where
    W: UnwindSafe

impl<W> RefUnwindSafe for GnuBuilder<W> where
    W: 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]