[][src]Struct broccoli::BBox

#[repr(C)]pub struct BBox<N, T> {
    pub rect: Rect<N>,
    pub inner: T,
}

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

impl<N, T> BBox<N, T>[src]

#[must_use]pub fn new(rect: Rect<N>, inner: T) -> BBox<N, T>[src]

Constructor. Also consider using bbox()

impl<N: Copy, T> BBox<N, T>[src]

#[must_use]pub fn into_semi_direct(&mut self) -> BBox<N, &mut T>[src]

Creates a (Rect<N>,&mut T) from a (Rect<N>,T)

#[must_use]pub fn into_indirect(&mut self) -> &mut BBox<N, T>[src]

Simply returns a mutable reference

#[must_use]pub fn inner_as<B: 'static + Copy>(self) -> BBox<B, T> where
    N: AsPrimitive<B>, 
[src]

Change the number type of the Rect using promitive cast.

#[must_use]pub fn inner_into<A: From<N>>(self) -> BBox<A, T>[src]

Change the number type using From

#[must_use]pub fn inner_try_into<A: TryFrom<N>>(self) -> Result<BBox<A, T>, A::Error>[src]

Change the number type using TryFrom

Trait Implementations

impl<N: Num, T> Aabb for BBox<N, T>[src]

type Num = N

impl<N: Num, T, '_> Aabb for &'_ mut BBox<N, T>[src]

type Num = N

impl<N: Clone, T: Clone> Clone for BBox<N, T>[src]

impl<N: Copy, T: Copy> Copy for BBox<N, T>[src]

impl<N: Debug, T: Debug> Debug for BBox<N, T>[src]

impl<N: Num, T> HasInner for BBox<N, T>[src]

type Inner = T

impl<N: Num, T, '_> HasInner for &'_ mut BBox<N, T>[src]

type Inner = T

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

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Pointable for T

type Init = T

The type for initializers.

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.