pub enum BoxFit {
Fill,
Contain,
Cover,
FitWidth,
FitHeight,
None,
ScaleDown,
}Expand description
How a box should be inscribed into another box.
See also:
apply_box_fit, which applies the sizing semantics of these values (though not the alignment semantics).
Variants§
Fill
Fill the target box by distorting the source’s aspect ratio.
Contain
As large as possible while still containing the source entirely within the target box.
Cover
As small as possible while still covering the entire target box.
FitWidth
Make sure the full width of the source is shown, regardless of whether this means the source overflows the target box vertically.
FitHeight
Make sure the full height of the source is shown, regardless of whether this means the source overflows the target box horizontally.
None
Align the source within the target box (by default, centering) and discard any portions of the source that lie outside the box.
The source image is not resized.
ScaleDown
Align the source within the target box (by default, centering) and, if necessary, scale the source down to ensure that the source fits within the box.
This is the same as BoxFit::Contain if that would shrink the image,
otherwise it is the same as BoxFit::None.
Trait Implementations§
impl Copy for BoxFit
impl Eq for BoxFit
impl StructuralPartialEq for BoxFit
Auto Trait Implementations§
impl Forget for BoxFit
impl Freeze for BoxFit
impl Move for BoxFit
impl RefUnwindSafe for BoxFit
impl Send for BoxFit
impl Sync for BoxFit
impl Unpin for BoxFit
impl UnsafeUnpin for BoxFit
impl UnwindSafe for BoxFit
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.