[][src]Struct broccoli::container::TreeIndBase

pub struct TreeIndBase<'a, N: Num, T> { /* fields omitted */ }

This is a Vec<BBox<N,&'a mut T>> under the hood with the added guarentee that all the &'a mut T point to the same slice.

From this struct a user can create a TreeInd.

Implementations

impl<'a, N: Num, T> TreeIndBase<'a, N, T>[src]

pub fn new(
    bots: &'a mut [T],
    mut func: impl FnMut(&mut T) -> Rect<N>
) -> TreeIndBase<'a, N, T>
[src]

Create a TreeIndBase.

Examples

 let mut aabbs = [
    broccoli::bbox(broccoli::rect(0isize, 10, 0, 10), 0),
 ];

 let mut base=broccoli::container::TreeIndBase::new(&mut aabbs,|a|a.rect); 
 let mut tree = base.build();

pub fn into_inner(self) -> Box<[BBox<N, &'a mut T>]>[src]

Extra the internals of a TreeIndBase.

Examples

 let mut aabbs = [
    broccoli::bbox(broccoli::rect(0isize, 10, 0, 10), 0),
 ];

 let mut base=broccoli::container::TreeIndBase::new(&mut aabbs,|a|a.rect); 
 let mut inner=base.into_inner();
 let mut tree = broccoli::new(&mut inner);
 //We can make a tree using the internals, but we lost the guarentee
 //that all the `&'a mut T` belong to the same slice.

pub fn build<'b>(&'b mut self) -> TreeInd<'a, 'b, N, T>[src]

Build a TreeInd.

Examples

 let mut aabbs = [
    broccoli::bbox(broccoli::rect(0isize, 10, 0, 10), 0),
 ];

 let mut base=broccoli::container::TreeIndBase::new(&mut aabbs,|a|a.rect); 
 let mut tree = base.build();

pub fn build_par<'b>(
    &'b mut self,
    joiner: impl Joinable
) -> TreeInd<'a, 'b, N, T> where
    N: Send + Sync,
    T: Send + Sync
[src]

Build a TreeInd.

Examples

 let mut aabbs = [
    broccoli::bbox(broccoli::rect(0isize, 10, 0, 10), 0),
 ];

 let mut base=broccoli::container::TreeIndBase::new(&mut aabbs,|a|a.rect); 
 let mut tree = base.build_par(broccoli::RayonJoin);

Auto Trait Implementations

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

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

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

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

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