tinymist_project::world::package::pack

Trait PackFs

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

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

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

Required Methods§

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

Read files from the package.

Provided Methods§

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

Read a file from the package.

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

Read entries from the package.

Implementors§

§

impl PackFs for GitHubReleasePack

§

impl PackFs for MapPack

§

impl PackFs for UniversePack

§

impl<P> PackFs for DirPack<P>
where P: AsRef<Path>,

§

impl<P> PackFs for GitClPack<P>
where P: AsRef<str>,

§

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

§

impl<S> PackFs for HttpPack<S>
where S: AsRef<str>,

§

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