#[non_exhaustive]pub struct Image {
pub image_url: String,
pub on_click: Option<OnClick>,
pub aspect_ratio: f64,
/* private fields */
}Expand description
An image that’s specified by a URL and can have an onclick action.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.image_url: StringThe URL of the image.
on_click: Option<OnClick>The onclick action.
aspect_ratio: f64The aspect ratio of this image (width and height). This field lets you reserve the right height for the image while waiting for it to load. It’s not meant to override the built-in aspect ratio of the image. If unset, the server fills it by prefetching the image.
Implementations§
Source§impl Image
impl Image
Sourcepub fn set_image_url<T: Into<String>>(self, v: T) -> Self
pub fn set_image_url<T: Into<String>>(self, v: T) -> Self
Sourcepub fn set_on_click<T>(self, v: T) -> Self
pub fn set_on_click<T>(self, v: T) -> Self
Sourcepub fn set_or_clear_on_click<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_on_click<T>(self, v: Option<T>) -> Self
Sourcepub fn set_aspect_ratio<T: Into<f64>>(self, v: T) -> Self
pub fn set_aspect_ratio<T: Into<f64>>(self, v: T) -> Self
Trait Implementations§
impl StructuralPartialEq for Image
Auto Trait Implementations§
impl Freeze for Image
impl RefUnwindSafe for Image
impl Send for Image
impl Sync for Image
impl Unpin for Image
impl UnsafeUnpin for Image
impl UnwindSafe for Image
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