Asset

Trait Asset 

Source
pub trait Asset: AssetManager {
    type Options: Clone;

    // Required methods
    fn fetch_with_progress(
        &self,
        options: Self::Options,
    ) -> Pin<Box<dyn Stream<Item = Progress> + Send + '_>>;
    fn fetch(
        &self,
        options: Self::Options,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<u8>, Error>> + Send + Sync + '_>>;
    fn name(&self) -> &str;
    fn update_baseurl(&self, baseurl: &Path);
}

Required Associated Types§

Required Methods§

Source

fn fetch_with_progress( &self, options: Self::Options, ) -> Pin<Box<dyn Stream<Item = Progress> + Send + '_>>

Source

fn fetch( &self, options: Self::Options, ) -> Pin<Box<dyn Future<Output = Result<Vec<u8>, Error>> + Send + Sync + '_>>

Source

fn name(&self) -> &str

Source

fn update_baseurl(&self, baseurl: &Path)

Implementations on Foreign Types§

Source§

impl<T, O> Asset for Option<T>
where T: Asset<Options = O> + Send + Sync + 'static, O: Clone + Send + Sync + 'static,

Source§

type Options = <T as Asset>::Options

Source§

fn fetch_with_progress( &self, options: Self::Options, ) -> Pin<Box<dyn Stream<Item = Progress> + Send + '_>>

Source§

fn fetch( &self, options: Self::Options, ) -> Pin<Box<dyn Future<Output = Result<Vec<u8>, Error>> + Send + Sync + '_>>

Source§

fn name(&self) -> &str

Source§

fn update_baseurl(&self, baseurl: &Path)

Implementors§

Source§

impl<'a, T> Asset for AssetRef<'a, T>
where T: Asset + Clone + AssetManager<Asset = T>,