pub struct Size {
pub width: f32,
pub height: f32,
}Fields§
§width: f32§height: f32Implementations§
Source§impl Size
impl Size
pub const ZERO: Self
pub const fn new(width: f32, height: f32) -> Self
pub fn is_empty(self) -> bool
Sourcepub fn clamp(self, min: Size, max: Size) -> Self
pub fn clamp(self, min: Size, max: Size) -> Self
This size within min..=max on each axis. Bounds that cannot hold a
size don’t panic, so one bad bound can’t take down a whole layout: a
NaN bound is ignored, a minimum above the maximum wins, as min-width
does over max-width in CSS, and a NaN length takes the minimum.
Trait Implementations§
impl Copy for Size
impl StructuralPartialEq for Size
Auto Trait Implementations§
impl Forget for Size
impl Freeze for Size
impl Move for Size
impl RefUnwindSafe for Size
impl Send for Size
impl Sync for Size
impl Unpin for Size
impl UnsafeUnpin for Size
impl UnwindSafe for Size
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