pub enum ObjectFit {
Fill,
Contain,
Cover,
}Expand description
How a sized piece of content (an image or SVG) is scaled into its layout box, mirroring CSS object-fit.
Variants§
Fill
Stretch to fill the box exactly, ignoring the intrinsic aspect ratio (may distort).
Contain
Scale uniformly to fit inside the box, centered, leaving letterbox gaps (no clipping).
Cover
Scale uniformly to cover the box, centered; the overflow must be clipped to the box.
Trait Implementations§
impl Copy for ObjectFit
impl Eq for ObjectFit
impl StructuralPartialEq for ObjectFit
Auto Trait Implementations§
impl Freeze for ObjectFit
impl RefUnwindSafe for ObjectFit
impl Send for ObjectFit
impl Sync for ObjectFit
impl Unpin for ObjectFit
impl UnsafeUnpin for ObjectFit
impl UnwindSafe for ObjectFit
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