[][src]Trait goods::Source

pub trait Source<K: ?Sized>: Send + Sync + 'static {
    fn read(
        &self,
        key: &K
    ) -> Pin<Box<dyn Future<Output = Result<Vec<u8>, SourceError>> + 'a>>; }

Asset data source.

Required methods

fn read(
    &self,
    key: &K
) -> Pin<Box<dyn Future<Output = Result<Vec<u8>, SourceError>> + 'a>>

Reads asset asynchronously. Returns async bytes on success. Otherwise returns error E describing occurred problem.

Loading content...

Implementors

impl<P: ?Sized> Source<P> for FileSource where
    P: AsRef<Path>, 
[src]

impl<U> Source<U> for ReqwestSource where
    U: IntoUrl + Clone + 'static, 
[src]

Loading content...