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> { ... }
}
Available on crate feature i-geo only.
Expand description

Functions that implement the geo interface.

Provided Methods§

source

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.

https://redis.io/commands/geoadd

source

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).

https://redis.io/commands/geohash

source

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.

https://redis.io/commands/geopos

source

fn geodist<R, K, S, D>( &self, key: K, src: S, dest: D, unit: Option<GeoUnit>, ) -> impl Future<Output = RedisResult<R>>

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

https://redis.io/commands/geodist

source

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>,

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).

https://redis.io/commands/georadius

source

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.

https://redis.io/commands/georadiusbymember

source

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>,

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.

https://redis.io/commands/geosearch

source

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>,

This command is like GEOSEARCH, but stores the result in destination key. Returns the number of members added to the destination key.

https://redis.io/commands/geosearchstore

Object Safety§

This trait is not object safe.

Implementors§