Skip to main content

EmbedFilesystemProvider

Trait EmbedFilesystemProvider 

Source
pub trait EmbedFilesystemProvider: Send + Sync {
    // Required method
    fn get(&self, path: &str) -> Option<EmbeddedFile>;
}
Expand description

Trait for providing access to embedded files.

This trait exists because rust-embed types are not dyn-compatible, so we need this abstraction layer to allow dynamic dispatch over different embedded file collections.

Required Methods§

Source

fn get(&self, path: &str) -> Option<EmbeddedFile>

Retrieves an embedded file by its path.

§Arguments
  • path - The path to the embedded file
§Returns

Returns the embedded file if found, or None if the path doesn’t exist.

Implementors§