Skip to main content

PackFs

Trait PackFs 

Source
pub trait PackFs: Debug {
    // Required method
    fn read_all(
        &mut self,
        f: &mut (dyn FnMut(&str, PackFile<'_>) -> PackageResult<()> + Send + Sync),
    ) -> PackageResult<()>;

    // Provided methods
    fn read(&self, _path: &str) -> Result<PackFile<'_>> { ... }
    fn entries(&self) -> Result<PackEntries<'_>> { ... }
}
Expand description

The pack trait is used for read/write files in a package.

Required Methods§

Source

fn read_all( &mut self, f: &mut (dyn FnMut(&str, PackFile<'_>) -> PackageResult<()> + Send + Sync), ) -> PackageResult<()>

Read files from the package.

Provided Methods§

Source

fn read(&self, _path: &str) -> Result<PackFile<'_>>

Read a file from the package.

Source

fn entries(&self) -> Result<PackEntries<'_>>

Read entries from the package.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§

Source§

impl PackFs for MapPack

Source§

impl<R: Read> PackFs for TarballPack<R>

Source§

impl<Src: PackFs, F: Fn(&str) -> bool + Send + Sync> PackFs for FilterPack<'_, Src, F>