Struct static_aabb2d_index::StaticAABB2DIndexBuilder[][src]

pub struct StaticAABB2DIndexBuilder<T = f64> where
    T: IndexableNum
{ /* fields omitted */ }

Used to build a StaticAABB2DIndex.

Implementations

impl<T> StaticAABB2DIndexBuilder<T> where
    T: IndexableNum
[src]

pub fn new(count: usize) -> Self[src]

Construct a new StaticAABB2DIndexBuilder to fit exactly the specified count number of items.

pub fn new_with_node_size(count: usize, node_size: usize) -> Self[src]

Construct a new StaticAABB2DIndexBuilder to fit exactly the specified count number of items and use node_size for the index tree shape.

Each node in the index tree has a maximum size which may be adjusted by node_size for performance reasons, however the default value of 16 when calling StaticAABB2DIndexBuilder::new is tested to be optimal in most cases.

If node_size is less than 2 then 2 is used, if node_size is greater than 65535 then 65535 is used.

pub fn add(&mut self, min_x: T, min_y: T, max_x: T, max_y: T) -> &mut Self[src]

Add an axis aligned bounding box with the extent points (min_x, min_y), (max_x, max_y) to the index.

For performance reasons the sanity checks of min_x <= max_x and min_y <= max_y are only debug asserted. If an invalid box is added it may lead to a panic or unexpected behavior from the constructed StaticAABB2DIndex.

pub fn build(self) -> Result<StaticAABB2DIndex<T>, StaticAABB2DIndexBuildError>[src]

Build the StaticAABB2DIndex with the boxes that have been added.

If the number of added items does not match the count given at the time the builder was created then a StaticAABB2DIndexBuildError::ItemCountError will be returned.

If the numeric type T fails to cast to/from a u16 for any reason then a StaticAABB2DIndexBuildError::NumericCastError will be returned.

Trait Implementations

impl<T: Clone> Clone for StaticAABB2DIndexBuilder<T> where
    T: IndexableNum
[src]

impl<T: Debug> Debug for StaticAABB2DIndexBuilder<T> where
    T: IndexableNum
[src]

Auto Trait Implementations

impl<T> RefUnwindSafe for StaticAABB2DIndexBuilder<T> where
    T: RefUnwindSafe

impl<T> Send for StaticAABB2DIndexBuilder<T> where
    T: Send

impl<T> Sync for StaticAABB2DIndexBuilder<T> where
    T: Sync

impl<T> Unpin for StaticAABB2DIndexBuilder<T> where
    T: Unpin

impl<T> UnwindSafe for StaticAABB2DIndexBuilder<T> where
    T: UnwindSafe

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> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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.