pub struct ImageLoader { /* private fields */ }Expand description
ImageLoader decodes encoded images into drawable Images with registered decoders.
Decoders are tried in the order given; put the platform’s native decoder first and a software
one after it. The loader is cheap to clone and every clone shares the same decoders and, with
with_worker (the worker feature), the same worker thread.
Implementations§
Source§impl ImageLoader
impl ImageLoader
Sourcepub fn new(images: ImageContext, decoders: Vec<Box<dyn Decoder>>) -> Self
pub fn new(images: ImageContext, decoders: Vec<Box<dyn Decoder>>) -> Self
new decodes on the polling thread: each Pending does its work inside its first poll.
This is the shape for hosts without threads, such as the web, and for hosts whose executor already runs on a background thread. Nothing is spawned.
Trait Implementations§
Source§impl Clone for ImageLoader
impl Clone for ImageLoader
Source§fn clone(&self) -> ImageLoader
fn clone(&self) -> ImageLoader
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl !RefUnwindSafe for ImageLoader
impl !UnwindSafe for ImageLoader
impl Freeze for ImageLoader
impl Send for ImageLoader
impl Sync for ImageLoader
impl Unpin for ImageLoader
impl UnsafeUnpin for ImageLoader
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more