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,

§

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>,

§

type Options = <T as Asset>::Options