[][src]Struct broccoli::container::TreeInd

#[repr(C)]pub struct TreeInd<'a, 'b, N: Num, T> { /* fields omitted */ }

A less general tree that provides collect functions and also derefs to a Tree.

TreeInd assumes there is a layer of indirection where all the pointers point to the same slice. It uses this assumption to provide collect functions that allow storing query results that can then be iterated through multiple times quickly.

Methods from Deref<Target = Tree<'b, BBox<N, &'a mut T>>>

#[must_use]pub fn get_height(&self) -> usize[src]

Examples

 use broccoli::build;
 const NUM_ELEMENT:usize=40;
 let mut bots = [axgeom::rect(0,10,0,10);NUM_ELEMENT];
 let mut tree = broccoli::new(&mut bots);

 assert_eq!(tree.get_height(),build::TreePreBuilder::new(NUM_ELEMENT).get_height());

#[must_use]pub fn num_aabbs(&self) -> usize[src]

Examples

 use broccoli::build;
 const NUM_ELEMENT:usize=7;
 let mut bots = [axgeom::rect(0,10,0,10);NUM_ELEMENT];
 let mut tree = broccoli::new(&mut bots);

 assert_eq!(tree.num_aabbs(),7);

#[must_use]pub fn num_nodes(&self) -> usize[src]

Examples

 use broccoli::build;
 let mut bots = [axgeom::rect(0,10,0,10)];
 let mut tree = broccoli::new(&mut bots);

 assert_eq!(tree.num_nodes(),build::TreePreBuilder::new(1).num_nodes());

#[must_use]pub fn get_nodes(&self) -> &[Node<'a, T>]

Notable traits for &'_ [u8]

impl<'_> Read for &'_ [u8]impl<'_> Write for &'_ mut [u8]
[src]

Examples

 let mut bots = [axgeom::rect(0,10,0,10)];
 let mut tree = broccoli::new(&mut bots);

 assert_eq!(tree.get_nodes()[0].range[0], axgeom::rect(0,10,0,10));

#[must_use]pub fn get_nodes_mut(&mut self) -> PMut<'_, [Node<'a, T>]>[src]

Examples

 let mut bots = [axgeom::rect(0,10,0,10)];
 let mut tree = broccoli::new(&mut bots);

 assert_eq!(tree.get_nodes_mut().get_index_mut(0).range[0], axgeom::rect(0,10,0,10));

#[must_use]pub fn get_elements_mut(&mut self) -> PMut<'_, [T]>[src]

Return the underlying slice of aabbs in the order sorted during tree construction.

Examples

 let mut bots = [axgeom::rect(0,10,0,10)];
 let mut tree = broccoli::new(&mut bots);

 assert_eq!(*tree.get_elements_mut().get_index_mut(0), axgeom::rect(0,10,0,10));

#[must_use]pub fn get_elements(&self) -> &[T]

Notable traits for &'_ [u8]

impl<'_> Read for &'_ [u8]impl<'_> Write for &'_ mut [u8]
[src]

Return the underlying slice of aabbs in the order sorted during tree construction.

Examples

 let mut bots = [axgeom::rect(0,10,0,10)];
 let tree = broccoli::new(&mut bots);

 assert_eq!(tree.get_elements()[0], axgeom::rect(0,10,0,10));

Trait Implementations

impl<'a, 'b, N: Num, T> Deref for TreeInd<'a, 'b, N, T>[src]

type Target = Tree<'b, BBox<N, &'a mut T>>

The resulting type after dereferencing.

impl<'a, 'b, N: Num, T> DerefMut for TreeInd<'a, 'b, N, T>[src]

impl<'a, 'b, N: Num, T> From<TreeInd<'a, 'b, N, T>> for Tree<'b, BBox<N, &'a mut T>>[src]

impl<'a, 'b, N: Num, T> FromSlice<'a, 'b> for TreeInd<'a, 'b, N, T>[src]

type T = BBox<N, &'a mut T>

The tree must be filled with T, which must have a pointer to Self::Inner.

type Inner = T

The type that the pointers are pointing to. The original slice is composed of this. Read more

type Num = N

The number type of the aabb.

Auto Trait Implementations

impl<'a, 'b, N, T> RefUnwindSafe for TreeInd<'a, 'b, N, T> where
    N: RefUnwindSafe,
    T: RefUnwindSafe
[src]

impl<'a, 'b, N, T> Send for TreeInd<'a, 'b, N, T> where
    N: Send,
    T: Send
[src]

impl<'a, 'b, N, T> Sync for TreeInd<'a, 'b, N, T> where
    N: Sync,
    T: Sync
[src]

impl<'a, 'b, N, T> Unpin for TreeInd<'a, 'b, N, T>[src]

impl<'a, 'b, N, T> !UnwindSafe for TreeInd<'a, 'b, N, T>[src]

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, 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.