Skip to main content

PathAccessModel

Trait PathAccessModel 

Source
pub trait PathAccessModel {
    // Required method
    fn content(&self, src: &Path) -> FileResult<Bytes>;

    // Provided method
    fn reset(&mut self) { ... }
}
Expand description

A trait for accessing underlying file system.

This trait is simplified by Vfs and requires a minimal method set for typst compilation.

Required Methods§

Source

fn content(&self, src: &Path) -> FileResult<Bytes>

Returns the content of a file entry.

Provided Methods§

Source

fn reset(&mut self)

Clears the cache of the access model.

This is called when the vfs is reset. See Vfs’s reset method for more information.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§