pub trait Files {
// Required methods
fn bytes(&self, path: &str) -> Option<Vec<u8>>;
fn list(&self, path: &str) -> Option<Vec<String>>;
// Provided methods
fn read(&self, path: &str) -> Option<String> { ... }
fn parse(&self, path: &str, source: &str) -> Result<Arc<File>, Problem> { ... }
fn image(&self, path: &str) -> Option<Result<Arc<ImageFile>, String>> { ... }
fn font(&self, path: &str) -> Option<Result<Arc<FontFile>, String>> { ... }
}Expand description
Reads a design’s files by their path from the top of the served folder.
Required Methods§
Provided Methods§
Sourcefn parse(&self, path: &str, source: &str) -> Result<Arc<File>, Problem>
fn parse(&self, path: &str, source: &str) -> Result<Arc<File>, Problem>
The design file at path, whose text is source, parsed. A store
that keeps files between resolves matches it against the file’s last
parse (crate::ids::matched), so its elements keep their ids — and
the nodes they make theirs — across saves.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".