Struct broccoli::aabb::BBox

source ·
pub struct BBox<N, T> {
    pub rect: Rect<N>,
    pub inner: T,
}
Expand description

A bounding box container object that implements Aabb and HasInner. Note that &mut BBox<N,T> also implements Aabb and HasInner.

Using this one struct the user can construct the following types for bboxes to be inserted into the tree:

  • BBox<N,T> (direct)
  • &mut BBox<N,T> (indirect)
  • BBox<N,&mut T> (rect direct, T indirect)

Fields§

§rect: Rect<N>§inner: T

Implementations§

source§

impl<N, T> BBox<N, T>

source

pub fn new(rect: Rect<N>, inner: T) -> BBox<N, T>

Constructor. Also consider using crate::bbox()

source

pub fn many_swap(self) -> ManySwappable<Self>

Trait Implementations§

source§

impl<N: Num, T> Aabb for &mut BBox<N, T>

§

type Num = N

source§

fn get(&self) -> &Rect<N>

source§

impl<N: Num, T> Aabb for BBox<N, T>

§

type Num = N

source§

fn get(&self) -> &Rect<Self::Num>

source§

impl<N: Clone, T: Clone> Clone for BBox<N, T>

source§

fn clone(&self) -> BBox<N, T>

Returns a copy of the value. Read more
1.0.0 · source§

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

Performs copy-assignment from source. Read more
source§

impl<N: Debug, T: Debug> Debug for BBox<N, T>

source§

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

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

impl<N: Num, T> HasInner for &mut BBox<N, T>

§

type Inner = T

source§

fn destruct_mut(&mut self) -> (&Rect<Self::Num>, &mut Self::Inner)

source§

fn get_inner_mut(&mut self) -> &mut Self::Inner

source§

impl<N: Num, T> HasInner for BBox<N, T>

§

type Inner = T

source§

fn destruct_mut(&mut self) -> (&Rect<Self::Num>, &mut Self::Inner)

source§

fn get_inner_mut(&mut self) -> &mut Self::Inner

source§

impl<N: Copy, T: Copy> Copy for BBox<N, T>

source§

impl<'a, N, T> ManySwap for BBox<N, &'a mut T>

source§

impl<N> ManySwap for BBox<N, ()>

source§

impl<N> ManySwap for BBox<N, u32>

source§

impl<N> ManySwap for BBox<N, u64>

source§

impl<N> ManySwap for BBox<N, usize>

Auto Trait Implementations§

§

impl<N, T> RefUnwindSafe for BBox<N, T>where N: RefUnwindSafe, T: RefUnwindSafe,

§

impl<N, T> Send for BBox<N, T>where N: Send, T: Send,

§

impl<N, T> Sync for BBox<N, T>where N: Sync, T: Sync,

§

impl<N, T> Unpin for BBox<N, T>where N: Unpin, T: Unpin,

§

impl<N, T> UnwindSafe for BBox<N, T>where N: UnwindSafe, T: UnwindSafe,

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

source§

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

Mutably borrows from an owned value. 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 Twhere 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> ToOwned for Twhere T: Clone,

§

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 Twhere U: Into<T>,

§

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 Twhere U: TryFrom<T>,

§

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.