Skip to main content

VirtualFileSystem

Trait VirtualFileSystem 

Source
pub trait VirtualFileSystem:
    Send
    + Sync
    + 'static {
    // Required methods
    fn contents(&self, url: &Url) -> Fallible<String>;
    fn exists(&self, url: &Url) -> bool;
    fn path_url(&self, path: &Path) -> Fallible<Url>;
    fn url_display(&self, url: &Url) -> String;
}

Required Methods§

Source

fn contents(&self, url: &Url) -> Fallible<String>

Loads the contents of the given URL (or fail with a useful error).

Source

fn exists(&self, url: &Url) -> bool

True if the given URL exists.

Source

fn path_url(&self, path: &Path) -> Fallible<Url>

(Try to) convert a path on the local file system to a URL

Source

fn url_display(&self, url: &Url) -> String

Return a string for the way we should display url to the user

Implementors§