Trait QueryResultsStorage

Source
pub trait QueryResultsStorage {
    // Required methods
    fn push(&mut self, intersection: Intersection) -> bool;
    fn clear(&mut self);
    fn sort_intersections_by<C: FnMut(&Intersection, &Intersection) -> Ordering>(
        &mut self,
        cmp: C,
    );
}
Expand description

A trait for ray cast results storage. It has two implementations: Vec and ArrayVec. Latter is needed for the cases where you need to avoid runtime memory allocations and do everything on stack.

Required Methods§

Source

fn push(&mut self, intersection: Intersection) -> bool

Pushes new intersection in the storage. Returns true if intersection was successfully inserted, false otherwise.

Source

fn clear(&mut self)

Clears the storage.

Source

fn sort_intersections_by<C: FnMut(&Intersection, &Intersection) -> Ordering>( &mut self, cmp: C, )

Sorts intersections by given compare function.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl QueryResultsStorage for Vec<Intersection>

Source§

fn push(&mut self, intersection: Intersection) -> bool

Source§

fn clear(&mut self)

Source§

fn sort_intersections_by<C>(&mut self, cmp: C)

Implementors§