pub trait Format: Send + Sync {
// Required method
fn worker(&self, threads: u32) -> Result<Box<dyn Worker + '_>>;
// Provided methods
fn stream(&self, _unit: &Unit) -> Result<Option<Stream>> { ... }
fn solid(&self) -> Option<&Solid> { ... }
fn serial(&self) -> bool { ... }
fn refuses_in_place(&self) -> Option<String> { ... }
fn password_check(&self) -> PasswordCheck { ... }
fn prove_password(&self) -> Result<()> { ... }
}Required Methods§
Provided Methods§
Sourcefn stream(&self, _unit: &Unit) -> Result<Option<Stream>>
fn stream(&self, _unit: &Unit) -> Result<Option<Stream>>
For a unit holding one file whose data resumable can decode from
the middle: where that data lies. Such units can free their archive
bytes while they are extracted instead of only once they are done.
Sourcefn solid(&self) -> Option<&Solid>
fn solid(&self) -> Option<&Solid>
For an archive that is one compressed stream, decodable only from the front: its single unit, extracted front to back while the bytes behind the decoder are freed.
Sourcefn serial(&self) -> bool
fn serial(&self) -> bool
The decoder finds a unit only by reading everything before it, and one handle can’t be shared between threads. A batch is then decoded on one thread by one worker, lowest unit first, so the worker can walk forward instead of starting over for every unit.
Sourcefn refuses_in_place(&self) -> Option<String>
fn refuses_in_place(&self) -> Option<String>
Why the archive can’t be extracted in place, if it can’t: it can still be extracted while it is kept.
fn password_check(&self) -> PasswordCheck
Sourcefn prove_password(&self) -> Result<()>
fn prove_password(&self) -> Result<()>
Proves the password from the headers alone; only called when
password_check says it can.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".