pub struct BoundingBox {
pub x0: f64,
pub y0: f64,
pub x1: f64,
pub y1: f64,
}Expand description
A bounding box.
Fields§
§x0: f64The left edge.
y0: f64The top edge.
x1: f64The right edge.
y1: f64The bottom edge.
Implementations§
Source§impl BoundingBox
impl BoundingBox
Sourcepub const fn new(x0: f64, y0: f64, x1: f64, y1: f64) -> Self
pub const fn new(x0: f64, y0: f64, x1: f64, y1: f64) -> Self
A new bounding box from minimum and maximum coordinates.
Sourcepub fn width(&self) -> f64
pub fn width(&self) -> f64
The width of the bounding box.
Note: nothing forbids negative width.
Trait Implementations§
Source§impl Clone for BoundingBox
impl Clone for BoundingBox
Source§fn clone(&self) -> BoundingBox
fn clone(&self) -> BoundingBox
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for BoundingBox
Source§impl Debug for BoundingBox
impl Debug for BoundingBox
Source§impl Default for BoundingBox
impl Default for BoundingBox
Source§fn default() -> BoundingBox
fn default() -> BoundingBox
Returns the “default value” for a type. Read more
Source§impl PartialEq for BoundingBox
impl PartialEq for BoundingBox
impl StructuralPartialEq for BoundingBox
Auto Trait Implementations§
impl Freeze for BoundingBox
impl RefUnwindSafe for BoundingBox
impl Send for BoundingBox
impl Sync for BoundingBox
impl Unpin for BoundingBox
impl UnsafeUnpin for BoundingBox
impl UnwindSafe for BoundingBox
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