ReadImageFromAsync

Trait ReadImageFromAsync 

Source
pub trait ReadImageFromAsync<T>: VfsAsync
where T: ImgFormat,
{ type ReadImageFuture<'a>: Future<Output = VfsResult<T, Self>> + Send + Unpin + 'a where Self: 'a; // Required method fn read_image_async<'a>( self: Pin<&'a Self>, path: <Self::Path as PathType>::OwnedPath, ) -> Self::ReadImageFuture<'a>; }
Available on crate features async and image only.
Expand description

A trait implemented by async vfs implementations that support reading images.

Required Associated Types§

Source

type ReadImageFuture<'a>: Future<Output = VfsResult<T, Self>> + Send + Unpin + 'a where Self: 'a

The future type returned by the read_image_async method.

Required Methods§

Source

fn read_image_async<'a>( self: Pin<&'a Self>, path: <Self::Path as PathType>::OwnedPath, ) -> Self::ReadImageFuture<'a>

Reads an image file at the specified path, returning the decoded image and its format.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl<'vfs, T> ReadImageFromAsync<T> for TokioFsVfs
where T: Send + 'static + ImgFormat,

Available on crate feature tokio only.
Source§

type ReadImageFuture<'a> = Pin<Box<dyn Future<Output = Result<T, Error<PathBuf>>> + Send + 'a>> where Self: 'a