Skip to main content

Crate tar_codec

Crate tar_codec 

Source
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.
EntryMetadata
Minimal regular-file metadata accepted by Builder::add_entry.
LentPayload
A member payload that keeps its lending Members cursor borrowed.
MemberMetadata
Common metadata for one archive member.
Members
A consuming, lending member cursor.

Enums§

BuildError
A failure while constructing an archive.
ExtractError
An error produced while securely extracting an archive.
ExtractPolicyViolation
A valid member feature rejected by the selected extract::ExtractPolicy.
Member
One format-neutral archive member.
SpecialKind
A special-file kind that generic extraction deliberately rejects.
TraversalError
A failure while traversing a recursive archive source.

Traits§

Archive
A one-pass archive that can enumerate and extract format-neutral members.
ArchiveBuilder
A format-specific archive writer that can create a stateful Builder.
MemberPayload
A streaming cursor over one archive member’s payload.

Functions§

default_name_validator
Applies the default archive name policy.

Type Aliases§

NameValidator
A predicate that accepts or rejects one UTF-8 archive name.