pub struct Octree<L: LocCode, D: Send + Sync> {
pub content: HashMap<L, OctreeNode<D>>,
/* private fields */
}
Fields§
§content: HashMap<L, OctreeNode<D>>
Implementations§
Source§impl<'a, T, D> Octree<T, D>
impl<'a, T, D> Octree<T, D>
Sourcepub fn with_capacity(max_depth: u32, size: usize) -> Self
pub fn with_capacity(max_depth: u32, size: usize) -> Self
Create an Octree with given pre-allocated space.
pub fn depth(&self) -> u32
Sourcepub fn lookup(&self, loc_code: T) -> Option<&OctreeNode<D>>
pub fn lookup(&self, loc_code: T) -> Option<&OctreeNode<D>>
Return a tree node a node.
Sourcepub fn insert(&mut self, location: T, node: OctreeNode<D>) -> T
pub fn insert(&mut self, location: T, node: OctreeNode<D>) -> T
Insert a tree node.
pub fn remove_node(&mut self, loc_code: T)
Sourcepub fn transform<U: From<D> + Send + Sync>(self) -> Octree<T, U>
pub fn transform<U: From<D> + Send + Sync>(self) -> Octree<T, U>
Transform an Octree of data D into an Octree of data U, provided that
U implement From
Sourcepub fn transform_fn<U: Send + Sync, F: Fn(D) -> U + Sync>(
self,
function: F,
) -> Octree<T, U>
pub fn transform_fn<U: Send + Sync, F: Fn(D) -> U + Sync>( self, function: F, ) -> Octree<T, U>
tree.transform_fn(Rgb::from_hex);
Sourcepub fn transform_nodes_fn<U: Send + Sync, F: Fn(T, OctreeNode<D>) -> OctreeNode<U> + Sync>(
self,
function: F,
) -> Octree<T, U>
pub fn transform_nodes_fn<U: Send + Sync, F: Fn(T, OctreeNode<D>) -> OctreeNode<U> + Sync>( self, function: F, ) -> Octree<T, U>
tree.transform_fn(Rgb::from_hex);
Trait Implementations§
Auto Trait Implementations§
impl<L, D> Freeze for Octree<L, D>
impl<L, D> RefUnwindSafe for Octree<L, D>where
L: RefUnwindSafe,
D: RefUnwindSafe,
impl<L, D> Send for Octree<L, D>
impl<L, D> Sync for Octree<L, D>
impl<L, D> Unpin for Octree<L, D>
impl<L, D> UnwindSafe for Octree<L, D>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more