[−][src]Struct broccoli::query::colfind::builder::QueryBuilder
Builder for a query on a DinoTree.
Implementations
impl<'a, 'b: 'a, T: Aabb + Send + Sync> QueryBuilder<'a, 'b, T> where
T::Num: Send + Sync,
[src]
T::Num: Send + Sync,
pub fn query_par(
self,
joiner: impl Joinable,
func: impl Fn(PMut<'_, T>, PMut<'_, T>) + Clone + Send + Sync
)
[src]
self,
joiner: impl Joinable,
func: impl Fn(PMut<'_, T>, PMut<'_, T>) + Clone + Send + Sync
)
Perform the query in parallel, switching to sequential as specified
by the QueryBuilder::with_switch_height()
pub fn query_par_ext(
self,
joiner: impl Joinable,
sweeper: &mut impl CollisionHandler<T = T> + Splitter + Send + Sync,
splitter: &mut impl Splitter + Send + Sync
)
[src]
self,
joiner: impl Joinable,
sweeper: &mut impl CollisionHandler<T = T> + Splitter + Send + Sync,
splitter: &mut impl Splitter + Send + Sync
)
An extended version of find_colliding_pairs
. where the user can supply
callbacks to when new worker tasks are spawned and joined by rayon
.
Allows the user to potentially collect some aspect of every aabb collision in parallel.
sweeper
: The splitter div/add functions will be called every time a new parallel recurse is started.
splitter
: The splitter div/add will be called at every level of recursion.
Examples
use broccoli::{prelude::*,RayonJoin,rect,bbox,query,query::colfind::builder::Consumer}; let mut bots = [bbox(rect(0,10,0,10),0u8),bbox(rect(5,15,5,15),1u8)]; let mut tree = broccoli::new(&mut bots); let mut handler=query::colfind::builder::from_closure( &tree, Vec::new(), |_|(Vec::new(),Vec::new()), //Start a new thread |a,mut b,mut c|{a.append(&mut b);a.append(&mut c)}, //Combine two threads |v,a,b|v.push((*a.unpack_inner(),*b.unpack_inner())), //Handle a collision ); tree.new_builder().query_par_ext( RayonJoin, &mut handler, &mut broccoli::build::SplitterEmpty ); let intersections=handler.consume(); assert_eq!(intersections.len(),1);
impl<'a, 'b: 'a, T: Aabb> QueryBuilder<'a, 'b, T>
[src]
#[must_use]pub fn with_switch_height(mut self: Self, height: usize) -> Self
[src]
Choose a custom height at which to switch from parallel to sequential. If you end up building sequentially, this option is ignored.
pub fn query_seq(self, func: impl FnMut(PMut<'_, T>, PMut<'_, T>))
[src]
Perform the query sequentially.
pub fn query_with_splitter_seq(
self,
func: impl FnMut(PMut<'_, T>, PMut<'_, T>),
splitter: &mut impl Splitter
)
[src]
self,
func: impl FnMut(PMut<'_, T>, PMut<'_, T>),
splitter: &mut impl Splitter
)
Perform the query sequentially with splitter functions getting called at every level of recursion.
Auto Trait Implementations
impl<'a, 'b, T> RefUnwindSafe for QueryBuilder<'a, 'b, T> where
T: RefUnwindSafe,
<T as Aabb>::Num: RefUnwindSafe,
[src]
T: RefUnwindSafe,
<T as Aabb>::Num: RefUnwindSafe,
impl<'a, 'b, T> Send for QueryBuilder<'a, 'b, T> where
T: Send,
<T as Aabb>::Num: Send,
[src]
T: Send,
<T as Aabb>::Num: Send,
impl<'a, 'b, T> Sync for QueryBuilder<'a, 'b, T> where
T: Sync,
<T as Aabb>::Num: Sync,
[src]
T: Sync,
<T as Aabb>::Num: Sync,
impl<'a, 'b, T> Unpin for QueryBuilder<'a, 'b, T> where
'b: 'a,
[src]
'b: 'a,
impl<'a, 'b, T> !UnwindSafe for QueryBuilder<'a, 'b, 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>,