Skip to main content

AssetSource

Trait AssetSource 

Source
pub trait AssetSource:
    Send
    + Sync
    + 'static {
    // Required method
    fn read(&self, path: &Path) -> Option<Vec<u8>>;
}
Expand description

Resolves a requested path to bytes, or declines it.

Sources are consulted on the main thread while the load is being queued, so read should be cheap: an index lookup and a copy, not a network round trip.

Required Methods§

Source

fn read(&self, path: &Path) -> Option<Vec<u8>>

Returns the bytes for path, or None to let the next source (and ultimately the filesystem) answer.

Implementors§