pub struct ContainerCaps {
pub read: bool,
pub write: bool,
pub forward_parse: bool,
pub degraded_parse: bool,
pub trailing_index: bool,
pub solid: bool,
pub per_entry_codec: bool,
pub needs_seek: bool,
pub stores_dirs: bool,
pub stores_symlinks: bool,
}Expand description
What a container can do, and what it needs from its input.
Fields§
§read: bool§write: bool§forward_parse: boolEntries can be enumerated from a forward-only source at full data fidelity (metadata may be approximate). True for zip, tar, cpio.
degraded_parse: boolOnly a best-effort salvage scan is possible forward-only. Distinct from
forward_parse: this rung yields partial results by construction.
trailing_index: boolThe authoritative index lives at the end of the stream (zip, 7z, rar).
solid: boolEntries share codec state, so reaching entry N decodes 1..N (7z, rar).
per_entry_codec: boolEach entry carries its own codec (zip, 7z).
needs_seek: boolRandom access is required even to enumerate (squashfs, iso).
stores_dirs: boolA directory can be recorded AS a directory, rather than as an empty regular file that happens to share its name.
ar is the counter-example and the reason this field exists: its
format has no directory concept at all, so writing one produces a
zero-byte file named proj/sub — after which an entry named
proj/sub/a.txt cannot be extracted, because its parent is a file.
A writer that cannot store the kind is expected to be told so by its
caller and warn, rather than emit the lie.
stores_symlinks: boolA symlink can be recorded as a link, target and all, rather than as a regular file carrying the target text as its contents.
Implementations§
Source§impl ContainerCaps
impl ContainerCaps
Sourcepub const fn read_only() -> Self
pub const fn read_only() -> Self
A container that can be read but not written — RAR, whose compressor is proprietary.
Sourcepub const fn read_write() -> Self
pub const fn read_write() -> Self
A container supporting both directions. Every other capability stays false — a constructor must not claim what a format has not.
Trait Implementations§
Source§impl Clone for ContainerCaps
impl Clone for ContainerCaps
Source§fn clone(&self) -> ContainerCaps
fn clone(&self) -> ContainerCaps
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more