[−][src]Module broccoli::pmut
Provides a mutable pointer type that is more restrictive that &mut T
, in order
to protect tree invariants.
PMut
is short for protected mutable reference.
use broccoli::{prelude::*,bbox,rect}; let mut bots=[bbox(rect(0,10,0,10),0)]; let mut tree=broccoli::new(&mut bots); tree.find_colliding_pairs_mut(|a,b|{ //We cannot allow the user to swap these two //bots. They should be allowed to mutate //whats inside each of them (aside from their aabb), //but not swap. //core::mem::swap(a,b); // We cannot allow this!!!! //This is allowed. core::mem::swap(a.unpack_inner(),b.unpack_inner()); })
Structs
PMut | A protected mutable reference. A protected mutable reference that derefs to |
PMutIter | Iterator produced by |
Traits
HasInner | 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. |