pub struct GeoIndex { /* private fields */ }Expand description
In-memory geospatial index using grid cells
Implementations§
Source§impl GeoIndex
impl GeoIndex
pub fn new() -> Self
Sourcepub fn index_event(&self, event: &Event)
pub fn index_event(&self, event: &Event)
Index an event’s coordinates (if extractable)
Sourcepub fn get_coordinate(&self, event_id: &Uuid) -> Option<Coordinate>
pub fn get_coordinate(&self, event_id: &Uuid) -> Option<Coordinate>
Get coordinate for an event
Sourcepub fn query_bbox(&self, bbox: &BoundingBox) -> Vec<(Uuid, Coordinate)>
pub fn query_bbox(&self, bbox: &BoundingBox) -> Vec<(Uuid, Coordinate)>
Find all event IDs within a bounding box
Sourcepub fn query_radius(&self, query: &RadiusQuery) -> Vec<(Uuid, Coordinate, f64)>
pub fn query_radius(&self, query: &RadiusQuery) -> Vec<(Uuid, Coordinate, f64)>
Find all event IDs within a radius
pub fn is_empty(&self) -> bool
Sourcepub fn stats(&self) -> GeoIndexStats
pub fn stats(&self) -> GeoIndexStats
Statistics about the geo index
Trait Implementations§
Auto Trait Implementations§
impl Freeze for GeoIndex
impl !RefUnwindSafe for GeoIndex
impl Send for GeoIndex
impl Sync for GeoIndex
impl Unpin for GeoIndex
impl UnsafeUnpin for GeoIndex
impl UnwindSafe for GeoIndex
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more