pub struct Size {
pub width: f32,
pub height: f32,
}Fields§
§width: f32§height: f32Implementations§
Source§impl Size
impl Size
pub const ZERO: Size
pub const fn new(width: f32, height: f32) -> Size
pub fn is_empty(self) -> bool
Sourcepub fn clamp(self, min: Size, max: Size) -> Size
pub fn clamp(self, min: Size, max: Size) -> Size
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
Source§impl From<Size> for AnimationValue
impl From<Size> for AnimationValue
Source§fn from(value: Size) -> AnimationValue
fn from(value: Size) -> AnimationValue
Converts to this type from the input type.
Source§impl Interpolate for Size
impl Interpolate for Size
fn interpolate(from: Size, to: Size, t: f32) -> Size
Source§fn extrapolate(from: Size, to: Size, t: f32) -> Size
fn extrapolate(from: Size, to: Size, t: f32) -> Size
Like
Interpolate::interpolate, but lets t leave 0..=1 so a
spring can overshoot its target. Values that cannot extend past their
endpoints, such as colors, clamp instead.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
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<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.