[][src]Struct broccoli::Tree

#[repr(transparent)]pub struct Tree<'a, A: Axis, T: Aabb> { /* fields omitted */ }

The data structure this crate revoles around.

Implementations

impl<'a, A: Axis, T: Aabb> Tree<'a, A, T>[src]

pub fn with_axis(axis: A, bots: &'a mut [T]) -> Tree<'a, A, T>[src]

Create a Tree using a specified axis.

Examples

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

pub fn with_axis_par(axis: A, bots: &'a mut [T]) -> Tree<'a, A, T> where
    T: Send + Sync,
    T::Num: Send + Sync
[src]

Create a Tree using a specified axis in parallel.

Examples

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

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

Examples

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

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

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

Examples

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

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

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

Notable traits for &'_ mut [u8]

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

Examples

 use broccoli::analyze;
 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

 use broccoli::analyze;
 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));

Trait Implementations

impl<'a, A: Axis, T: Aabb> NaiveCheck<'a, Tree<'a, A, T>> for TreeRef<'a, A, T>[src]

type A = A

type T = T

type Num = T::Num

impl<'a, A: Axis, T: Aabb> Queries<'a> for Tree<'a, A, T>[src]

type A = A

type T = T

type Num = T::Num

Auto Trait Implementations

impl<'a, A, T> RefUnwindSafe for Tree<'a, A, T> where
    A: RefUnwindSafe,
    T: RefUnwindSafe,
    <T as Aabb>::Num: RefUnwindSafe
[src]

impl<'a, A, T> Send for Tree<'a, A, T> where
    T: Send,
    <T as Aabb>::Num: Send
[src]

impl<'a, A, T> Sync for Tree<'a, A, T> where
    T: Sync,
    <T as Aabb>::Num: Sync
[src]

impl<'a, A, T> Unpin for Tree<'a, A, T> where
    A: Unpin
[src]

impl<'a, A, T> !UnwindSafe for Tree<'a, A, 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.