[][src]Trait pixel_widgets::loader::Loader

pub trait Loader: 'static + Send + Sync {
    type Load: Future<Output = Result<Vec<u8>, Self::Error>> + Send + Sync;
    type Wait: Future<Output = Result<(), Self::Error>> + Send + Sync;
    type Error: Error + Send;
    fn load(&self, url: impl AsRef<str>) -> Self::Load;
fn wait(&self, url: impl AsRef<str>) -> Self::Wait; }

A way to load URLs from a data source.

Included implementations:

  • PathBuf, loads data from disk using the PathBuf as working directory.

Associated Types

type Load: Future<Output = Result<Vec<u8>, Self::Error>> + Send + Sync

A future returned when calling load.

type Wait: Future<Output = Result<(), Self::Error>> + Send + Sync

A future returned when calling wait.

type Error: Error + Send

Error returned by the loader when the request failed.

Loading content...

Required methods

fn load(&self, url: impl AsRef<str>) -> Self::Load

Asynchronously load a resource located at the given url

fn wait(&self, url: impl AsRef<str>) -> Self::Wait

Wait for a resource to be modified externally.

Loading content...

Implementors

impl Loader for FsLoader[src]

type Load = Ready<Result<Vec<u8>, Self::Error>>

type Wait = Map<Receiver<Result<(), Self::Error>>, fn(_: Result<Result<(), Self::Error>, Canceled>) -> Result<(), Self::Error>>

type Error = Error

Loading content...