Trait broccoli::pmut::HasInner[][src]

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

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

Required methods

Implementors