[][src]Trait broccoli::HasInner

pub unsafe trait HasInner: Aabb {
    type Inner;
    pub fn get_inner(&self) -> (&Rect<Self::Num>, &Self::Inner);
pub fn get_inner_mut(&mut self) -> (&Rect<Self::Num>, &mut Self::Inner); pub fn inner_mut(&mut self) -> &mut Self::Inner { ... }
pub fn inner(&self) -> &Self::Inner { ... } }

Trait exposes an api where you can return a read-only reference to the axis-aligned bounding box and at the same time return a mutable reference to a seperate inner section.

The trait in unsafe since an incorrect implementation could allow the user to get mutable references to each element in the tree allowing them to swap them and thus violating invariants of the tree. This can be done if the user were to implement with type Inner=Self

We have no easy way to ensure that the Inner type only points to the inner portion of a AABB so we mark this trait as unsafe.

Associated Types

Loading content...

Required methods

pub fn get_inner(&self) -> (&Rect<Self::Num>, &Self::Inner)[src]

pub fn get_inner_mut(&mut self) -> (&Rect<Self::Num>, &mut Self::Inner)[src]

Loading content...

Provided methods

pub fn inner_mut(&mut self) -> &mut Self::Inner[src]

pub fn inner(&self) -> &Self::Inner[src]

Loading content...

Implementors

impl<'a, T: HasInner> HasInner for PMut<'a, T>[src]

type Inner = T::Inner

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

Loading content...