Expand description
High-level decoding and encoding for tar archives.
See decode for tar decoding, encode for pax encoding,
Builder for format-neutral construction, and
Archive::extract_in for format-neutral extraction.
§Security and correctness
Like other tar parsers, tar-codec assumes that it has unique access to the target directory (the “extraction root”) when extracting, and to any targeted inputs when building a new archive. Concurrent mutation of files under the extraction root or of files being added to an archive is outside of the threat model.
See the repository’s SECURITY.md for more information.
Re-exports§
pub use decode::DecodeError;pub use decode::DecodePolicy;pub use decode::DecodePolicyViolation;pub use decode::PaxDecodePolicy;pub use decode::TarArchive;pub use decode::TarMemberPayload;pub use encode::EncodeError;pub use encode::TarEncoder;
Modules§
- builder
- Format-neutral archive construction.
- decode
- Member-oriented decoding of pax or GNU tar streams.
- encode
- Pure-pax tar encoding for the format-neutral archive builder.
- extract
- Format-neutral archive extraction.
Structs§
- Builder
- A stateful format-neutral archive construction engine.
- Entry
Metadata - Minimal regular-file metadata accepted by
Builder::add_entry. - Lent
Payload - A member payload that keeps its lending
Memberscursor borrowed. - Member
Metadata - Common metadata for one archive member.
- Members
- A consuming, lending member cursor.
Enums§
- Build
Error - A failure while constructing an archive.
- Extract
Error - An error produced while securely extracting an archive.
- Extract
Policy Violation - A valid member feature rejected by the selected
extract::ExtractPolicy. - Member
- One format-neutral archive member.
- Special
Kind - A special-file kind that generic extraction deliberately rejects.
- Traversal
Error - A failure while traversing a recursive archive source.
Traits§
- Archive
- A one-pass archive that can enumerate and extract format-neutral members.
- Archive
Builder - A format-specific archive writer that can create a stateful
Builder. - Member
Payload - A streaming cursor over one archive member’s payload.
Functions§
- default_
name_ validator - Applies the default archive name policy.
Type Aliases§
- Name
Validator - A predicate that accepts or rejects one UTF-8 archive name.