pub struct ImageProps {
pub source: String,
pub decorative: bool,
pub content_mode: ContentMode,
pub aspect_ratio: Option<f64>,
pub tint: Option<Color>,
}Fields§
§source: StringResolved asset path or name; backend loads through its image pipeline (§18.2).
decorative: bool§content_mode: ContentModeHow the image scales within its frame (default ContentMode::Fit — no stretching).
aspect_ratio: Option<f64>Optional width:height ratio the view is constrained to (e.g. 16.0/9.0). None lets the
image take its allocated frame.
tint: Option<Color>Monochrome tint for a template/vector glyph (docs/vectors.md): backends that can,
recolor natively (template rendering on Apple, drawable tint on Android, pixel
recolor on GTK); backends that can’t yet ignore it and draw the source colors.
None (the default, and every raster image(…)) means “as authored”.
Trait Implementations§
Source§impl Clone for ImageProps
impl Clone for ImageProps
Source§fn clone(&self) -> ImageProps
fn clone(&self) -> ImageProps
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 moreSource§impl Debug for ImageProps
impl Debug for ImageProps
Source§impl Default for ImageProps
impl Default for ImageProps
Source§fn default() -> ImageProps
fn default() -> ImageProps
Returns the “default value” for a type. Read more
Source§impl PartialEq for ImageProps
impl PartialEq for ImageProps
Source§fn eq(&self, other: &ImageProps) -> bool
fn eq(&self, other: &ImageProps) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for ImageProps
Auto Trait Implementations§
impl Freeze for ImageProps
impl RefUnwindSafe for ImageProps
impl Send for ImageProps
impl Sync for ImageProps
impl Unpin for ImageProps
impl UnsafeUnpin for ImageProps
impl UnwindSafe for ImageProps
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