Trait redis_driver::GeoCommands
source · pub trait GeoCommands {
fn geoadd<K, M, I>(
&mut self,
key: K,
condition: GeoAddCondition,
change: bool,
items: I
) -> PreparedCommand<'_, Self, usize>
where
Self: Sized,
K: Into<BulkString>,
M: Into<BulkString>,
I: ArgsOrCollection<(f64, f64, M)>,
{ ... }
fn geodist<K, M>(
&mut self,
key: K,
member1: M,
member2: M,
unit: GeoUnit
) -> PreparedCommand<'_, Self, Option<f64>>
where
Self: Sized,
K: Into<BulkString>,
M: Into<BulkString>,
{ ... }
fn geohash<K, M, C>(
&mut self,
key: K,
members: C
) -> PreparedCommand<'_, Self, Vec<String>>
where
Self: Sized,
K: Into<BulkString>,
M: Into<BulkString>,
C: SingleArgOrCollection<M>,
{ ... }
fn geopos<K, M, C>(
&mut self,
key: K,
members: C
) -> PreparedCommand<'_, Self, Vec<Option<(f64, f64)>>>
where
Self: Sized,
K: Into<BulkString>,
M: Into<BulkString>,
C: SingleArgOrCollection<M>,
{ ... }
fn geosearch<K, M1, M2, A>(
&mut self,
key: K,
from: GeoSearchFrom<M1>,
by: GeoSearchBy,
options: GeoSearchOptions
) -> PreparedCommand<'_, Self, A>
where
Self: Sized,
K: Into<BulkString>,
M1: Into<BulkString>,
M2: FromValue,
A: FromSingleValueArray<GeoSearchResult<M2>>,
{ ... }
fn geosearchstore<D, S, M>(
&mut self,
destination: D,
source: S,
from: GeoSearchFrom<M>,
by: GeoSearchBy,
options: GeoSearchStoreOptions
) -> PreparedCommand<'_, Self, usize>
where
Self: Sized,
D: Into<BulkString>,
S: Into<BulkString>,
M: Into<BulkString>,
{ ... }
}
Expand description
Provided Methods
sourcefn geoadd<K, M, I>(
&mut self,
key: K,
condition: GeoAddCondition,
change: bool,
items: I
) -> PreparedCommand<'_, Self, usize>where
Self: Sized,
K: Into<BulkString>,
M: Into<BulkString>,
I: ArgsOrCollection<(f64, f64, M)>,
fn geoadd<K, M, I>(
&mut self,
key: K,
condition: GeoAddCondition,
change: bool,
items: I
) -> PreparedCommand<'_, Self, usize>where
Self: Sized,
K: Into<BulkString>,
M: Into<BulkString>,
I: ArgsOrCollection<(f64, f64, M)>,
Adds the specified geospatial items (longitude, latitude, name) to the specified key.
Return
- When used without optional arguments, the number of elements added to the sorted set (excluding score updates).
- If the CH option is specified, the number of elements that were changed (added or updated).
See Also
sourcefn geodist<K, M>(
&mut self,
key: K,
member1: M,
member2: M,
unit: GeoUnit
) -> PreparedCommand<'_, Self, Option<f64>>where
Self: Sized,
K: Into<BulkString>,
M: Into<BulkString>,
fn geodist<K, M>(
&mut self,
key: K,
member1: M,
member2: M,
unit: GeoUnit
) -> PreparedCommand<'_, Self, Option<f64>>where
Self: Sized,
K: Into<BulkString>,
M: Into<BulkString>,
sourcefn geohash<K, M, C>(
&mut self,
key: K,
members: C
) -> PreparedCommand<'_, Self, Vec<String>>where
Self: Sized,
K: Into<BulkString>,
M: Into<BulkString>,
C: SingleArgOrCollection<M>,
fn geohash<K, M, C>(
&mut self,
key: K,
members: C
) -> PreparedCommand<'_, Self, Vec<String>>where
Self: Sized,
K: Into<BulkString>,
M: Into<BulkString>,
C: SingleArgOrCollection<M>,
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).
Return
An array where each element is the Geohash corresponding to each member name passed as argument to the command.
See Also
sourcefn geopos<K, M, C>(
&mut self,
key: K,
members: C
) -> PreparedCommand<'_, Self, Vec<Option<(f64, f64)>>>where
Self: Sized,
K: Into<BulkString>,
M: Into<BulkString>,
C: SingleArgOrCollection<M>,
fn geopos<K, M, C>(
&mut self,
key: K,
members: C
) -> PreparedCommand<'_, Self, Vec<Option<(f64, f64)>>>where
Self: Sized,
K: Into<BulkString>,
M: Into<BulkString>,
C: SingleArgOrCollection<M>,
Return the positions (longitude,latitude) of all the specified members of the geospatial index represented by the sorted set at key.
Return
n array where each element is a two elements array representing longitude and latitude (x,y) of each member name passed as argument to the command. Non existing elements are reported as NULL elements of the array.