Skip to main content

Pack

Trait Pack 

Source
pub trait Pack {
    type File: File;

    // Required method
    fn get_file_by_path(&self, path: &str) -> Option<&Self::File>;
}
Expand description

Trait representing Pack, a container for files identified by path.

Most users will use PackArchived implementation, returned by crate::loader::load. This trait is also implemented for non-archived Pack_, mostly for testing purposes.

Required Associated Types§

Source

type File: File

File type returned by this pack.

Required Methods§

Source

fn get_file_by_path(&self, path: &str) -> Option<&Self::File>

Given pack relative path, eg. /dir1/dir2/file.html returns file associated with this path. Returns None if file for given path does not exist.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementations on Foreign Types§

Source§

impl Pack for Pack

Source§

type File = File

Source§

fn get_file_by_path(&self, path: &str) -> Option<&Self::File>

Source§

impl Pack for PackArchived

Implementors§