pub struct ImageRequest { /* private fields */ }Expand description
The image to load, and the largest size in pixels it is drawn at.
Implementations§
Source§impl ImageRequest
impl ImageRequest
Sourcepub fn new(url: impl Into<Arc<str>>) -> Self
pub fn new(url: impl Into<Arc<str>>) -> Self
An image at url: http://, https://, file:// or a file path.
Sourcepub fn bytes(key: impl Into<Arc<str>>, bytes: impl Into<Arc<[u8]>>) -> Self
pub fn bytes(key: impl Into<Arc<str>>, bytes: impl Into<Arc<[u8]>>) -> Self
An image in encoded bytes (PNG, JPEG, WebP or GIF) the app already
holds. key names it in the memory cache; one key is one image.
Sourcepub fn max_size(self, width: u32, height: u32) -> Self
pub fn max_size(self, width: u32, height: u32) -> Self
Decodes the image no larger than width × height pixels, keeping
its aspect ratio: a thumbnail of a large photo holds a thumbnail’s
memory. Pass the size it is drawn at, in device pixels.
Sourcepub fn or_max_size(self, width: u32, height: u32) -> Self
pub fn or_max_size(self, width: u32, height: u32) -> Self
max_size, unless the request already has one: a
composable that knows the size it draws at fills it in, and an app
that asked for a size keeps it.
Trait Implementations§
Source§impl Clone for ImageRequest
impl Clone for ImageRequest
Source§impl Debug for ImageRequest
impl Debug for ImageRequest
impl Eq for ImageRequest
Source§impl Hash for ImageRequest
impl Hash for ImageRequest
Source§impl PartialEq for ImageRequest
impl PartialEq for ImageRequest
impl StructuralPartialEq for ImageRequest
Auto Trait Implementations§
impl Freeze for ImageRequest
impl RefUnwindSafe for ImageRequest
impl Send for ImageRequest
impl Sync for ImageRequest
impl Unpin for ImageRequest
impl UnsafeUnpin for ImageRequest
impl UnwindSafe for ImageRequest
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