#[non_exhaustive]pub enum ImageMode {
AspectFill,
AspectFit,
ScaleToFill,
Center,
}Expand description
Content-fit mode for an [Image]. The variant names mirror the
camelCase wire strings the iOS and Android image-view modules
dispatch on (packages/whisker-image/ios/Sources/WhiskerImage/,
packages/whisker-image/android/src/main/kotlin/.../WhiskerImageView.kt).
#[non_exhaustive] so a future fit mode (cover, contain, …) can
be added without breaking exhaustive matches downstream.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
AspectFill
"aspectFill" — scale to fill the box while preserving aspect
ratio, cropping the long edge. The default.
AspectFit
"aspectFit" — scale to fit inside the box while preserving
aspect ratio, letterboxing the short edge.
ScaleToFill
"scaleToFill" — stretch to exactly fill the box, ignoring
the aspect ratio.
Center
"center" — render at the source’s intrinsic size, centered.
Implementations§
Trait Implementations§
impl Copy for ImageMode
impl Eq for ImageMode
impl StructuralPartialEq for ImageMode
Auto Trait Implementations§
impl Freeze for ImageMode
impl RefUnwindSafe for ImageMode
impl Send for ImageMode
impl Sync for ImageMode
impl Unpin for ImageMode
impl UnsafeUnpin for ImageMode
impl UnwindSafe for ImageMode
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