pub struct KDTreeRef<'a, N: IndexableNum> { /* private fields */ }
Expand description
A reference on an external KDTree buffer.
Implementations§
Source§impl<'a, N: IndexableNum> KDTreeRef<'a, N>
impl<'a, N: IndexableNum> KDTreeRef<'a, N>
Sourcepub fn try_new<T: AsRef<[u8]>>(data: &'a T) -> Result<Self, GeoIndexError>
pub fn try_new<T: AsRef<[u8]>>(data: &'a T) -> Result<Self, GeoIndexError>
Construct a new KDTreeRef from an external byte slice.
This byte slice must conform to the “kdbush ABI”, that is, the ABI originally implemented
by the JavaScript kdbush
library. You can extract
such a buffer either via KDTree::into_inner
or from the .data
attribute of the
JavaScript KDBush
object.
Sourcepub unsafe fn new_unchecked<T: AsRef<[u8]>>(
data: &'a T,
metadata: KDTreeMetadata<N>,
) -> Result<Self, GeoIndexError>
pub unsafe fn new_unchecked<T: AsRef<[u8]>>( data: &'a T, metadata: KDTreeMetadata<N>, ) -> Result<Self, GeoIndexError>
Construct a new KDTreeRef without doing any validation
§Safety
metadata
must be valid for this data buffer.
Trait Implementations§
Source§impl<N: IndexableNum> KDTreeIndex<N> for KDTreeRef<'_, N>
impl<N: IndexableNum> KDTreeIndex<N> for KDTreeRef<'_, N>
Source§fn metadata(&self) -> &KDTreeMetadata<N>
fn metadata(&self) -> &KDTreeMetadata<N>
Access the metadata describing this KDTree
Source§fn range(&self, min_x: N, min_y: N, max_x: N, max_y: N) -> Vec<u32>
fn range(&self, min_x: N, min_y: N, max_x: N, max_y: N) -> Vec<u32>
Search the index for items within a given bounding box. Read more
Source§fn range_rect(&self, rect: &impl RectTrait<T = N>) -> Vec<u32>
fn range_rect(&self, rect: &impl RectTrait<T = N>) -> Vec<u32>
Search the index for items within a given bounding box. Read more
Source§fn within(&self, qx: N, qy: N, r: N) -> Vec<u32>
fn within(&self, qx: N, qy: N, r: N) -> Vec<u32>
Search the index for items within a given radius. Read more
Source§fn within_coord(&self, coord: &impl CoordTrait<T = N>, r: N) -> Vec<u32>
fn within_coord(&self, coord: &impl CoordTrait<T = N>, r: N) -> Vec<u32>
Search the index for items within a given radius. Read more
impl<'a, N: IndexableNum> StructuralPartialEq for KDTreeRef<'a, N>
Auto Trait Implementations§
impl<'a, N> Freeze for KDTreeRef<'a, N>
impl<'a, N> RefUnwindSafe for KDTreeRef<'a, N>where
N: RefUnwindSafe,
impl<'a, N> Send for KDTreeRef<'a, N>
impl<'a, N> Sync for KDTreeRef<'a, N>
impl<'a, N> Unpin for KDTreeRef<'a, N>where
N: Unpin,
impl<'a, N> UnwindSafe for KDTreeRef<'a, N>where
N: RefUnwindSafe + 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