Trait GeoCommands

Source
pub trait GeoCommands {
    // Provided methods
    fn geoadd<K, M, I>(
        &mut self,
        key: K,
        condition: GeoAddCondition,
        change: bool,
        items: I,
    ) -> PreparedCommand<'_, Self, usize>
       where Self: Sized,
             K: Into<CommandArg>,
             M: Into<CommandArg>,
             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<CommandArg>,
             M: Into<CommandArg> { ... }
    fn geohash<K, M, C>(
        &mut self,
        key: K,
        members: C,
    ) -> PreparedCommand<'_, Self, Vec<String>>
       where Self: Sized,
             K: Into<CommandArg>,
             M: Into<CommandArg>,
             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<CommandArg>,
             M: Into<CommandArg>,
             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<CommandArg>,
             M1: Into<CommandArg>,
             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<CommandArg>,
             S: Into<CommandArg>,
             M: Into<CommandArg> { ... }
}
Expand description

A group of Redis commands related to Geospatial indices

§See Also

Redis Geospatial Commands

Provided Methods§

Source

fn geoadd<K, M, I>( &mut self, key: K, condition: GeoAddCondition, change: bool, items: I, ) -> PreparedCommand<'_, Self, usize>
where Self: Sized, K: Into<CommandArg>, M: Into<CommandArg>, 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

https://redis.io/commands/geoadd/

Source

fn geodist<K, M>( &mut self, key: K, member1: M, member2: M, unit: GeoUnit, ) -> PreparedCommand<'_, Self, Option<f64>>
where Self: Sized, K: Into<CommandArg>, M: Into<CommandArg>,

Return the distance between two members in the geospatial index represented by the sorted set.

§Return

The distance in the specified unit, or None if one or both the elements are missing.

§See Also

https://redis.io/commands/geodist/

Source

fn geohash<K, M, C>( &mut self, key: K, members: C, ) -> PreparedCommand<'_, Self, Vec<String>>

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

https://redis.io/commands/geohash/

Source

fn geopos<K, M, C>( &mut self, key: K, members: C, ) -> PreparedCommand<'_, Self, Vec<Option<(f64, f64)>>>

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.

§See Also

https://redis.io/commands/geopos/

Source

fn geosearch<K, M1, M2, A>( &mut self, key: K, from: GeoSearchFrom<M1>, by: GeoSearchBy, options: GeoSearchOptions, ) -> PreparedCommand<'_, Self, A>

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.

§Return

An array of members + additional information depending on which with_xyz options have been selected

§See Also

https://redis.io/commands/geosearch/

Source

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<CommandArg>, S: Into<CommandArg>, M: Into<CommandArg>,

This command is like geosearch, but stores the result in destination key.

§Return

the number of elements in the resulting set.

§See Also

https://redis.io/commands/geosearchstore/

Implementors§