1 //! A library for reading and writing TAR archives
2 //!
3 //! This library provides utilities necessary to manage [TAR archives][1]
4 //! abstracted over a reader or writer. Great strides are taken to ensure that
5 //! an archive is never required to be fully resident in memory, and all objects
6 //! provide largely a streaming interface to read bytes from.
7 //!
8 //! [1]: http://en.wikipedia.org/wiki/Tar_%28computing%29
9
10 // More docs about the detailed tar format can also be found here:
11 // http://www.freebsd.org/cgi/man.cgi?query=tar&sektion=5&manpath=FreeBSD+8-current
12
13 // NB: some of the coding patterns and idioms here may seem a little strange.
14 // This is currently attempting to expose a super generic interface while
15 // also not forcing clients to codegen the entire crate each time they use
16 // it. To that end lots of work is done to ensure that concrete
17 // implementations are all found in this crate and the generic functions are
18 // all just super thin wrappers (e.g. easy to codegen).
19
20 #![doc(html_root_url = "https://docs.rs/tar/0.4")]
21 #![deny(missing_docs)]
22 #![cfg_attr(test, deny(warnings))]
23
24 use std::io::{Error, ErrorKind};
25
26 pub use crate::archive::{Archive, Entries};
27 pub use crate::builder::Builder;
28 pub use crate::entry::{Entry, Unpacked};
29 pub use crate::entry_type::EntryType;
30 pub use crate::header::GnuExtSparseHeader;
31 pub use crate::header::{GnuHeader, GnuSparseHeader, Header, HeaderMode, OldHeader, UstarHeader};
32 pub use crate::pax::{PaxExtension, PaxExtensions};
33
34 mod archive;
35 mod builder;
36 mod entry;
37 mod entry_type;
38 mod error;
39 mod header;
40 mod pax;
41
other(msg: &str) -> Error42 fn other(msg: &str) -> Error {
43 Error::new(ErrorKind::Other, msg)
44 }
45