pub struct Rect {
pub origin: Point,
pub size: Size,
}Fields§
§origin: Point§size: SizeImplementations§
Source§impl Rect
impl Rect
pub const ZERO: Rect
pub const fn new(x: f32, y: f32, width: f32, height: f32) -> Rect
pub const fn from_origin_size(origin: Point, size: Size) -> Rect
pub fn from_points(min: Point, max: Point) -> Rect
pub const fn x(self) -> f32
pub const fn y(self) -> f32
pub const fn width(self) -> f32
pub const fn height(self) -> f32
pub fn max_x(self) -> f32
pub fn max_y(self) -> f32
pub fn is_empty(self) -> bool
pub fn contains(self, point: Point) -> bool
pub fn translate(self, delta: Vector) -> Rect
pub fn inflate(self, x: f32, y: f32) -> Rect
pub fn intersection(self, other: Rect) -> Option<Rect>
pub fn union(self, other: Rect) -> Rect
Trait Implementations§
impl Copy for Rect
Source§impl From<Rect> for AnimationValue
impl From<Rect> for AnimationValue
Source§fn from(value: Rect) -> AnimationValue
fn from(value: Rect) -> AnimationValue
Converts to this type from the input type.
impl StructuralPartialEq for Rect
Auto Trait Implementations§
impl Freeze for Rect
impl RefUnwindSafe for Rect
impl Send for Rect
impl Sync for Rect
impl Unpin for Rect
impl UnsafeUnpin for Rect
impl UnwindSafe for Rect
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.