Skip to main content

Format

Trait Format 

Source
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> { ... }
}

Required Methods§

Source

fn worker(&self, threads: u32) -> Result<Box<dyn Worker + '_>>

A worker decodes units on one thread. threads is a hint for codecs that can decode a single stream on several cores.

Provided Methods§

Source

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.

Source

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.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§