[−][src]Struct broccoli::container::TreeIndBase
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]
bots: &'a mut [T],
mut func: impl FnMut(&mut T) -> Rect<N>
) -> TreeIndBase<'a, N, T>
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]
&'b mut self,
joiner: impl Joinable
) -> TreeInd<'a, 'b, N, T> where
N: Send + Sync,
T: Send + Sync,
Auto Trait Implementations
impl<'a, N, T> RefUnwindSafe for TreeIndBase<'a, N, T> where
N: RefUnwindSafe,
T: RefUnwindSafe,
[src]
N: RefUnwindSafe,
T: RefUnwindSafe,
impl<'a, N, T> Send for TreeIndBase<'a, N, T> where
N: Send,
T: Send,
[src]
N: Send,
T: Send,
impl<'a, N, T> Sync for TreeIndBase<'a, N, T> where
N: Sync,
T: Sync,
[src]
N: Sync,
T: Sync,
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]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Pointable for T
pub const ALIGN: usize
type Init = T
The type for initializers.
pub unsafe fn init(init: <T as Pointable>::Init) -> usize
pub unsafe fn deref<'a>(ptr: usize) -> &'a T
pub unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T
pub unsafe fn drop(ptr: usize)
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,