Struct static_aabb2d_index::StaticAABB2DIndexBuilder [−][src]
Used to build a StaticAABB2DIndex.
Implementations
impl<T> StaticAABB2DIndexBuilder<T> where
T: IndexableNum,
[src]
T: IndexableNum,
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]
T: IndexableNum,
fn clone(&self) -> StaticAABB2DIndexBuilder<T>
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl<T: Debug> Debug for StaticAABB2DIndexBuilder<T> where
T: IndexableNum,
[src]
T: IndexableNum,
Auto Trait Implementations
impl<T> RefUnwindSafe for StaticAABB2DIndexBuilder<T> where
T: RefUnwindSafe,
T: RefUnwindSafe,
impl<T> Send for StaticAABB2DIndexBuilder<T> where
T: Send,
T: Send,
impl<T> Sync for StaticAABB2DIndexBuilder<T> where
T: Sync,
T: Sync,
impl<T> Unpin for StaticAABB2DIndexBuilder<T> where
T: Unpin,
T: Unpin,
impl<T> UnwindSafe for StaticAABB2DIndexBuilder<T> where
T: UnwindSafe,
T: UnwindSafe,
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> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
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>,