pub trait AssetSource:
Send
+ Sync
+ 'static {
// Required methods
fn read(&self, path: &str) -> Option<Vec<u8>>;
fn list(&self, dir: &str) -> Vec<String>;
fn name(&self) -> &str;
}Expand description
A single layer of the overlay filesystem.
Implementations must be cheaply cloneable-by-Arc: crate::Assets
shares sources behind Arc<dyn AssetSource> for zero-cost cloning.
Required Methods§
Sourcefn read(&self, path: &str) -> Option<Vec<u8>>
fn read(&self, path: &str) -> Option<Vec<u8>>
Return the bytes at path if this layer provides it.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".