pub struct Rectangle {
pub min: Point,
pub max: Point,
}Fields§
§min: Point§max: PointImplementations§
Source§impl Rectangle
impl Rectangle
pub fn new(min: Point, max: Point) -> Rectangle
pub fn from_point(pt: Point) -> Rectangle
pub fn from_disk(center: Point, radius: i32) -> Rectangle
pub fn from_segment( start: Point, end: Point, start_radius: i32, end_radius: i32, ) -> Rectangle
pub fn to_boundary(&self) -> Boundary
pub fn diag2(&self) -> u32
pub fn includes(&self, pt: Point) -> bool
pub fn contains(&self, rect: &Rectangle) -> bool
pub fn overlaps(&self, rect: &Rectangle) -> bool
pub fn extends(&self, rect: &Rectangle) -> bool
pub fn touches(&self, rect: &Rectangle) -> bool
pub fn merge(&mut self, pt: Point)
pub fn absorb(&mut self, rect: &Rectangle)
pub fn intersection(&self, rect: &Rectangle) -> Option<Rectangle>
pub fn is_empty(&self) -> bool
pub fn width(&self) -> u32
pub fn height(&self) -> u32
pub fn ratio(&self) -> f32
pub fn area(&self) -> u32
pub fn center(&self) -> Point
pub fn grow(&mut self, edges: &Edge)
pub fn shrink(&mut self, edges: &Edge)
Trait Implementations§
Source§impl AddAssign<Point> for Rectangle
impl AddAssign<Point> for Rectangle
Source§fn add_assign(&mut self, rhs: Point)
fn add_assign(&mut self, rhs: Point)
Performs the
+= operation. Read moreSource§impl Ord for Rectangle
impl Ord for Rectangle
Source§impl PartialOrd for Rectangle
impl PartialOrd for Rectangle
Source§impl SubAssign<Point> for Rectangle
impl SubAssign<Point> for Rectangle
Source§fn sub_assign(&mut self, rhs: Point)
fn sub_assign(&mut self, rhs: Point)
Performs the
-= operation. Read moreimpl Copy for Rectangle
impl Eq for Rectangle
impl StructuralPartialEq for Rectangle
Auto Trait Implementations§
impl Freeze for Rectangle
impl RefUnwindSafe for Rectangle
impl Send for Rectangle
impl Sync for Rectangle
impl Unpin for Rectangle
impl UnwindSafe for Rectangle
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Converts
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Converts
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Converts
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Converts
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.§impl<T> DowncastSend for T
impl<T> DowncastSend for T
§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.