Trait fred::interfaces::GeoInterface
source · pub trait GeoInterface: ClientLike + Sized {
// Provided methods
fn geoadd<R, K, V>(
&self,
key: K,
options: Option<SetOptions>,
changed: bool,
values: V,
) -> impl Future<Output = RedisResult<R>>
where R: FromRedis,
K: Into<RedisKey>,
V: Into<MultipleGeoValues> { ... }
fn geohash<R, K, V>(
&self,
key: K,
members: V,
) -> impl Future<Output = RedisResult<R>>
where R: FromRedis,
K: Into<RedisKey>,
V: TryInto<MultipleValues>,
V::Error: Into<RedisError> { ... }
fn geopos<R, K, V>(
&self,
key: K,
members: V,
) -> impl Future<Output = RedisResult<R>>
where R: FromRedis,
K: Into<RedisKey>,
V: TryInto<MultipleValues>,
V::Error: Into<RedisError> { ... }
fn geodist<R, K, S, D>(
&self,
key: K,
src: S,
dest: D,
unit: Option<GeoUnit>,
) -> impl Future<Output = RedisResult<R>>
where R: FromRedis,
K: Into<RedisKey>,
S: TryInto<RedisValue>,
S::Error: Into<RedisError>,
D: TryInto<RedisValue>,
D::Error: Into<RedisError> { ... }
fn georadius<R, K, P>(
&self,
key: K,
position: P,
radius: f64,
unit: GeoUnit,
withcoord: bool,
withdist: bool,
withhash: bool,
count: Option<(u64, Any)>,
ord: Option<SortOrder>,
store: Option<RedisKey>,
storedist: Option<RedisKey>,
) -> impl Future<Output = RedisResult<R>>
where R: FromRedis,
K: Into<RedisKey>,
P: Into<GeoPosition> { ... }
fn georadiusbymember<R, K, V>(
&self,
key: K,
member: V,
radius: f64,
unit: GeoUnit,
withcoord: bool,
withdist: bool,
withhash: bool,
count: Option<(u64, Any)>,
ord: Option<SortOrder>,
store: Option<RedisKey>,
storedist: Option<RedisKey>,
) -> impl Future<Output = RedisResult<R>>
where R: FromRedis,
K: Into<RedisKey>,
V: TryInto<RedisValue>,
V::Error: Into<RedisError> { ... }
fn geosearch<R, K>(
&self,
key: K,
from_member: Option<RedisValue>,
from_lonlat: Option<GeoPosition>,
by_radius: Option<(f64, GeoUnit)>,
by_box: Option<(f64, f64, GeoUnit)>,
ord: Option<SortOrder>,
count: Option<(u64, Any)>,
withcoord: bool,
withdist: bool,
withhash: bool,
) -> impl Future<Output = RedisResult<R>>
where R: FromRedis,
K: Into<RedisKey> { ... }
fn geosearchstore<R, D, S>(
&self,
dest: D,
source: S,
from_member: Option<RedisValue>,
from_lonlat: Option<GeoPosition>,
by_radius: Option<(f64, GeoUnit)>,
by_box: Option<(f64, f64, GeoUnit)>,
ord: Option<SortOrder>,
count: Option<(u64, Any)>,
storedist: bool,
) -> impl Future<Output = RedisResult<R>>
where R: FromRedis,
D: Into<RedisKey>,
S: Into<RedisKey> { ... }
}i-geo only.Expand description
Functions that implement the geo interface.
Provided Methods§
sourcefn geoadd<R, K, V>(
&self,
key: K,
options: Option<SetOptions>,
changed: bool,
values: V,
) -> impl Future<Output = RedisResult<R>>
fn geoadd<R, K, V>( &self, key: K, options: Option<SetOptions>, changed: bool, values: V, ) -> impl Future<Output = RedisResult<R>>
Adds the specified geospatial items (longitude, latitude, name) to the specified key.
sourcefn geohash<R, K, V>(
&self,
key: K,
members: V,
) -> impl Future<Output = RedisResult<R>>
fn geohash<R, K, V>( &self, key: K, members: V, ) -> impl Future<Output = RedisResult<R>>
Return valid Geohash strings representing the position of one or more elements in a sorted set value representing a geospatial index (where elements were added using GEOADD).
sourcefn geopos<R, K, V>(
&self,
key: K,
members: V,
) -> impl Future<Output = RedisResult<R>>
fn geopos<R, K, V>( &self, key: K, members: V, ) -> impl Future<Output = RedisResult<R>>
Return the positions (longitude,latitude) of all the specified members of the geospatial index represented by the sorted set at key.
Callers can use as_geo_position to lazily parse results as needed.
sourcefn geodist<R, K, S, D>(
&self,
key: K,
src: S,
dest: D,
unit: Option<GeoUnit>,
) -> impl Future<Output = RedisResult<R>>where
R: FromRedis,
K: Into<RedisKey>,
S: TryInto<RedisValue>,
S::Error: Into<RedisError>,
D: TryInto<RedisValue>,
D::Error: Into<RedisError>,
fn geodist<R, K, S, D>(
&self,
key: K,
src: S,
dest: D,
unit: Option<GeoUnit>,
) -> impl Future<Output = RedisResult<R>>where
R: FromRedis,
K: Into<RedisKey>,
S: TryInto<RedisValue>,
S::Error: Into<RedisError>,
D: TryInto<RedisValue>,
D::Error: Into<RedisError>,
Return the distance between two members in the geospatial index represented by the sorted set.
sourcefn georadius<R, K, P>(
&self,
key: K,
position: P,
radius: f64,
unit: GeoUnit,
withcoord: bool,
withdist: bool,
withhash: bool,
count: Option<(u64, Any)>,
ord: Option<SortOrder>,
store: Option<RedisKey>,
storedist: Option<RedisKey>,
) -> impl Future<Output = RedisResult<R>>
fn georadius<R, K, P>( &self, key: K, position: P, radius: f64, unit: GeoUnit, withcoord: bool, withdist: bool, withhash: bool, count: Option<(u64, Any)>, ord: Option<SortOrder>, store: Option<RedisKey>, storedist: Option<RedisKey>, ) -> impl Future<Output = RedisResult<R>>
Return the members of a sorted set populated with geospatial information using GEOADD, which are within the borders of the area specified with the center location and the maximum distance from the center (the radius).
sourcefn georadiusbymember<R, K, V>(
&self,
key: K,
member: V,
radius: f64,
unit: GeoUnit,
withcoord: bool,
withdist: bool,
withhash: bool,
count: Option<(u64, Any)>,
ord: Option<SortOrder>,
store: Option<RedisKey>,
storedist: Option<RedisKey>,
) -> impl Future<Output = RedisResult<R>>
fn georadiusbymember<R, K, V>( &self, key: K, member: V, radius: f64, unit: GeoUnit, withcoord: bool, withdist: bool, withhash: bool, count: Option<(u64, Any)>, ord: Option<SortOrder>, store: Option<RedisKey>, storedist: Option<RedisKey>, ) -> impl Future<Output = RedisResult<R>>
This command is exactly like GEORADIUS with the sole difference that instead of taking, as the center of the area to query, a longitude and latitude value, it takes the name of a member already existing inside the geospatial index represented by the sorted set.
sourcefn geosearch<R, K>(
&self,
key: K,
from_member: Option<RedisValue>,
from_lonlat: Option<GeoPosition>,
by_radius: Option<(f64, GeoUnit)>,
by_box: Option<(f64, f64, GeoUnit)>,
ord: Option<SortOrder>,
count: Option<(u64, Any)>,
withcoord: bool,
withdist: bool,
withhash: bool,
) -> impl Future<Output = RedisResult<R>>
fn geosearch<R, K>( &self, key: K, from_member: Option<RedisValue>, from_lonlat: Option<GeoPosition>, by_radius: Option<(f64, GeoUnit)>, by_box: Option<(f64, f64, GeoUnit)>, ord: Option<SortOrder>, count: Option<(u64, Any)>, withcoord: bool, withdist: bool, withhash: bool, ) -> impl Future<Output = RedisResult<R>>
Return the members of a sorted set populated with geospatial information using GEOADD, which are within the borders of the area specified by a given shape.
sourcefn geosearchstore<R, D, S>(
&self,
dest: D,
source: S,
from_member: Option<RedisValue>,
from_lonlat: Option<GeoPosition>,
by_radius: Option<(f64, GeoUnit)>,
by_box: Option<(f64, f64, GeoUnit)>,
ord: Option<SortOrder>,
count: Option<(u64, Any)>,
storedist: bool,
) -> impl Future<Output = RedisResult<R>>
fn geosearchstore<R, D, S>( &self, dest: D, source: S, from_member: Option<RedisValue>, from_lonlat: Option<GeoPosition>, by_radius: Option<(f64, GeoUnit)>, by_box: Option<(f64, f64, GeoUnit)>, ord: Option<SortOrder>, count: Option<(u64, Any)>, storedist: bool, ) -> impl Future<Output = RedisResult<R>>
This command is like GEOSEARCH, but stores the result in destination key. Returns the number of members added to the destination key.