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 method
    fn stream(&self, _unit: &Unit) -> Result<Option<Stream>> { ... }
}

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.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§