Skip to main content

tar_codec/
lib.rs

1//! High-level decoding and encoding for tar archives.
2//!
3//! See [`decode`] for tar decoding, [`encode`] for pax encoding,
4//! [`Builder`] for format-neutral construction, and
5//! [`Archive::extract_in`] for format-neutral extraction.
6//!
7//! ## Security and correctness
8//!
9//! Like other tar parsers, tar-codec assumes that it has unique access
10//! to the target directory (the "extraction root") when extracting,
11//! and to any targeted inputs when building a new archive.
12//! Concurrent mutation of files under the extraction root
13//! or of files being added to an archive is outside of the threat model.
14//!
15//! See the [repository's SECURITY.md](https://github.com/astral-sh/tar-codec/blob/main/SECURITY.md)
16//! for more information.
17
18pub mod decode;
19pub mod encode;
20
21pub use archive_trait::{
22    Archive, ArchiveBuilder, BuildError, Builder, EntryMetadata, ExtractError,
23    ExtractPolicyViolation, LentPayload, Member, MemberMetadata, MemberPayload, Members,
24    NameValidator, SpecialKind, TraversalError, default_name_validator,
25};
26pub use archive_trait::{builder, extract};
27pub use decode::{
28    DecodeError, DecodePolicy, DecodePolicyViolation, PaxDecodePolicy, TarArchive, TarMemberPayload,
29};
30pub use encode::{EncodeError, TarEncoder};