pub struct GeospatialManager { /* private fields */ }Implementations§
Source§impl GeospatialManager
impl GeospatialManager
Sourcepub async fn geoadd(
&self,
key: &str,
locations: Vec<Location>,
nx: bool,
xx: bool,
ch: bool,
) -> Result<usize>
pub async fn geoadd( &self, key: &str, locations: Vec<Location>, nx: bool, xx: bool, ch: bool, ) -> Result<usize>
Sourcepub async fn geodist(
&self,
key: &str,
member1: &str,
member2: &str,
unit: DistanceUnit,
) -> Result<Option<f64>>
pub async fn geodist( &self, key: &str, member1: &str, member2: &str, unit: DistanceUnit, ) -> Result<Option<f64>>
Sourcepub async fn georadius(
&self,
key: &str,
center_lat: f64,
center_lon: f64,
radius: f64,
unit: DistanceUnit,
with_dist: bool,
with_coord: bool,
count: Option<usize>,
sort: Option<&str>,
) -> Result<Vec<GeoradiusResult>>
pub async fn georadius( &self, key: &str, center_lat: f64, center_lon: f64, radius: f64, unit: DistanceUnit, with_dist: bool, with_coord: bool, count: Option<usize>, sort: Option<&str>, ) -> Result<Vec<GeoradiusResult>>
Query members within radius (GEORADIUS)
§Arguments
key- Geospatial keycenter_lat- Center latitudecenter_lon- Center longituderadius- Radiusunit- Distance unitwith_dist- Include distance in resultswith_coord- Include coordinates in resultscount- Maximum number of resultssort- Sort order (“ASC” or “DESC”)
§Returns
Vector of matching members with optional distance and coordinates
Sourcepub async fn georadiusbymember(
&self,
key: &str,
member: &str,
radius: f64,
unit: DistanceUnit,
with_dist: bool,
with_coord: bool,
count: Option<usize>,
sort: Option<&str>,
) -> Result<Vec<GeoradiusResult>>
pub async fn georadiusbymember( &self, key: &str, member: &str, radius: f64, unit: DistanceUnit, with_dist: bool, with_coord: bool, count: Option<usize>, sort: Option<&str>, ) -> Result<Vec<GeoradiusResult>>
Query members within radius of given member (GEORADIUSBYMEMBER)
§Arguments
key- Geospatial keymember- Center memberradius- Radiusunit- Distance unitwith_dist- Include distance in resultswith_coord- Include coordinates in resultscount- Maximum number of resultssort- Sort order (“ASC” or “DESC”)
§Returns
Vector of matching members with optional distance and coordinates
Sourcepub async fn geopos(
&self,
key: &str,
members: &[String],
) -> Result<Vec<Option<Coordinate>>>
pub async fn geopos( &self, key: &str, members: &[String], ) -> Result<Vec<Option<Coordinate>>>
Sourcepub async fn geosearch(
&self,
key: &str,
from_member: Option<&str>,
from_lonlat: Option<(f64, f64)>,
by_radius: Option<(f64, DistanceUnit)>,
by_box: Option<(f64, f64, DistanceUnit)>,
with_dist: bool,
with_coord: bool,
with_hash: bool,
count: Option<usize>,
sort: Option<&str>,
) -> Result<Vec<GeoradiusResult>>
pub async fn geosearch( &self, key: &str, from_member: Option<&str>, from_lonlat: Option<(f64, f64)>, by_radius: Option<(f64, DistanceUnit)>, by_box: Option<(f64, f64, DistanceUnit)>, with_dist: bool, with_coord: bool, with_hash: bool, count: Option<usize>, sort: Option<&str>, ) -> Result<Vec<GeoradiusResult>>
Advanced geospatial search (GEOSEARCH)
§Arguments
key- Geospatial keyfrom_member- Center member (mutually exclusive with from_lonlat)from_lonlat- Center coordinates as (lon, lat) tuple (mutually exclusive with from_member)by_radius- Search by radius as (radius, unit) tupleby_box- Search by bounding box as (width, height, unit) tuplewith_dist- Include distance in resultswith_coord- Include coordinates in resultswith_hash- Include geohash in results (not yet implemented)count- Maximum number of resultssort- Sort order (“ASC” or “DESC”)
§Returns
Vector of matching members with optional distance and coordinates
Sourcepub async fn stats(&self) -> Result<GeospatialStats>
pub async fn stats(&self) -> Result<GeospatialStats>
Retrieve geospatial statistics
Trait Implementations§
Source§impl Clone for GeospatialManager
impl Clone for GeospatialManager
Source§fn clone(&self) -> GeospatialManager
fn clone(&self) -> GeospatialManager
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for GeospatialManager
impl !RefUnwindSafe for GeospatialManager
impl Send for GeospatialManager
impl Sync for GeospatialManager
impl Unpin for GeospatialManager
impl UnsafeUnpin for GeospatialManager
impl !UnwindSafe for GeospatialManager
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