pub struct KDTreeBuilder<N: IndexableNum> { /* private fields */ }
Expand description
A builder to create an KDTree
.
Implementations§
Source§impl<N: IndexableNum> KDTreeBuilder<N>
impl<N: IndexableNum> KDTreeBuilder<N>
Sourcepub fn new(num_items: u32) -> Self
pub fn new(num_items: u32) -> Self
Create a new builder with the provided number of items and the default node size.
Sourcepub fn new_with_node_size(num_items: u32, node_size: u16) -> Self
pub fn new_with_node_size(num_items: u32, node_size: u16) -> Self
Create a new builder with the provided number of items and node size.
Sourcepub fn from_metadata(metadata: KDTreeMetadata<N>) -> Self
pub fn from_metadata(metadata: KDTreeMetadata<N>) -> Self
Create a new builder with the provided metadata
Sourcepub fn metadata(&self) -> &KDTreeMetadata<N>
pub fn metadata(&self) -> &KDTreeMetadata<N>
Access the underlying KDTreeMetadata of this instance.
Sourcepub fn add(&mut self, x: N, y: N) -> u32
pub fn add(&mut self, x: N, y: N) -> u32
Add a point to the KDTree.
This returns a positional index that provides a lookup back into the original data.
Sourcepub fn add_coord(&mut self, coord: &impl CoordTrait<T = N>) -> u32
pub fn add_coord(&mut self, coord: &impl CoordTrait<T = N>) -> u32
Add a coord to the KDTree.
This returns a positional index that provides a lookup back into the original data.
Sourcepub fn add_point(
&mut self,
point: &impl PointTrait<T = N>,
) -> Result<u32, GeoIndexError>
pub fn add_point( &mut self, point: &impl PointTrait<T = N>, ) -> Result<u32, GeoIndexError>
Add a point to the KDTree.
This returns a positional index that provides a lookup back into the original data.
§Errors
- If the point is empty.
Trait Implementations§
Auto Trait Implementations§
impl<N> Freeze for KDTreeBuilder<N>
impl<N> RefUnwindSafe for KDTreeBuilder<N>where
N: RefUnwindSafe,
impl<N> Send for KDTreeBuilder<N>
impl<N> Sync for KDTreeBuilder<N>
impl<N> Unpin for KDTreeBuilder<N>where
N: Unpin,
impl<N> UnwindSafe for KDTreeBuilder<N>where
N: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more