Skip to main content

AssetSource

Trait AssetSource 

Source
pub trait AssetSource:
    'static
    + Send
    + Sync {
    // Required methods
    fn load(&self, path: &str) -> Result<Option<Cow<'static, [u8]>>>;
    fn list(&self, path: &str) -> Result<Vec<SharedString>>;
}
Expand description

重导出资源加载相关类型 应用程序使用的资源来源。

Required Methods§

Source

fn load(&self, path: &str) -> Result<Option<Cow<'static, [u8]>>>

从源路径加载给定的资源。

Source

fn list(&self, path: &str) -> Result<Vec<SharedString>>

列出给定路径下的资源。

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl AssetSource for ()

Source§

fn load(&self, _path: &str) -> Result<Option<Cow<'static, [u8]>>>

Source§

fn list(&self, _path: &str) -> Result<Vec<SharedString>>

Implementors§