Skip to main content

Box

Struct Box 

Source
pub struct Box<P: PointTrait> { /* private fields */ }
Expand description

Axis-aligned bounding box.

Mirrors boost::geometry::model::box<P> from boost/geometry/geometries/box.hpp:64-172. The two corners are addressed by corner::MIN / corner::MAX, matching the traits::indexed_access<box, min_corner|max_corner, D> specialisations at boost/geometry/geometries/box.hpp:213-247.

Implementations§

Source§

impl<P: PointTrait> Box<P>

Source

pub const fn from_corners(min: P, max: P) -> Self

Construct a box from its minimum and maximum corners.

Mirrors the box(Point const& min_corner, Point const& max_corner) constructor at boost/geometry/geometries/box.hpp:103-110.

Source

pub const fn min(&self) -> &P

Borrow the minimum corner.

Mirrors b.min_corner() on model::box (boost/geometry/geometries/box.hpp:138-144); returns a reference rather than copying.

Source

pub const fn max(&self) -> &P

Borrow the maximum corner.

Mirrors b.max_corner() on model::box (boost/geometry/geometries/box.hpp:149-155).

Trait Implementations§

Source§

impl<P: PointMut> Box for Box<P>

Wire the Box concept up. The trait body is empty — the concept is satisfied by the two super-bounds Geometry and IndexedAccess already proven above.

Source§

impl<P: Clone + PointTrait> Clone for Box<P>

Source§

fn clone(&self) -> Box<P>

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<P: Copy + PointTrait> Copy for Box<P>

Source§

impl<P: Debug + PointTrait> Debug for Box<P>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<P: Default + PointTrait> Default for Box<P>

Source§

fn default() -> Box<P>

Returns the “default value” for a type. Read more
Source§

impl<P: PointTrait> Geometry for Box<P>

Tag this concrete type as a Box. Mirrors the traits::tag<model::box<...>> specialisation at boost/geometry/geometries/box.hpp:189-192.

Source§

type Kind = BoxTag

One of the *Tag types from geometry_tag. Read more
Source§

type Point = P

The point type this geometry is built from. For a value modelling Point, this is Self. Read more
Source§

impl<P: PointMut> IndexedAccess for Box<P>

Two-axis access on the box. Collapses the traits::indexed_access<box, min_corner|max_corner, D> specialisations at boost/geometry/geometries/box.hpp:213-247 into one Rust impl: the I axis selects the corner, D then dispatches to Point::get / Point::set on that corner.

Source§

fn get_indexed<const I: usize, const D: usize>(&self) -> P::Scalar

Read coordinate D of corner I. Read more
Source§

fn set_indexed<const I: usize, const D: usize>(&mut self, value: P::Scalar)

Write coordinate D of corner I. Read more
Source§

impl<P: PartialEq + PointTrait> PartialEq for Box<P>

Source§

fn eq(&self, other: &Box<P>) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl<A, const D: usize, OldCs, T, Cs> RebindGeometry<T, Cs> for Box<Point<A, D, OldCs>>

Source§

type Output = Box<Point<T, D, Cs>>

The corresponding rebound stock model.
Source§

impl<P: PartialEq + PointTrait> StructuralPartialEq for Box<P>

Auto Trait Implementations§

§

impl<P> Freeze for Box<P>
where P: Freeze,

§

impl<P> RefUnwindSafe for Box<P>
where P: RefUnwindSafe,

§

impl<P> Send for Box<P>
where P: Send,

§

impl<P> Sync for Box<P>
where P: Sync,

§

impl<P> Unpin for Box<P>
where P: Unpin,

§

impl<P> UnsafeUnpin for Box<P>
where P: UnsafeUnpin,

§

impl<P> UnwindSafe for Box<P>
where P: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> SameAs<T> for T

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.