Struct redis::geo::RadiusOptions [−][src]
This is supported on crate feature
geospatial
only.Options for the GEORADIUS and GEORADIUSBYMEMBER commands
Example
use redis::{Commands, RedisResult}; use redis::geo::{RadiusSearchResult, RadiusOptions, RadiusOrder, Unit}; fn nearest_in_radius( con: &mut redis::Connection, key: &str, longitude: f64, latitude: f64, meters: f64, limit: usize, ) -> RedisResult<Vec<RadiusSearchResult>> { let opts = RadiusOptions::default() .order(RadiusOrder::Asc) .limit(limit); con.geo_radius(key, longitude, latitude, meters, Unit::Meters, opts) }
Implementations
impl RadiusOptions
[src]
pub fn limit(self, n: usize) -> Self
[src]
Limit the results to the first N matching items.
pub fn with_dist(self) -> Self
[src]
Return the distance of the returned items from the specified center. The distance is returned in the same unit as the unit specified as the radius argument of the command.
pub fn with_coord(self) -> Self
[src]
Return the longitude, latitude
coordinates of the matching items.
pub fn order(self, o: RadiusOrder) -> Self
[src]
Sort the returned items
pub fn store<K: ToRedisArgs>(self, key: K) -> Self
[src]
Store the results in a sorted set at key
, instead of returning them.
This feature can't be used with any with_*
method.
pub fn store_dist<K: ToRedisArgs>(self, key: K) -> Self
[src]
Store the results in a sorted set at key
, with the distance from the
center as its score. This feature can't be used with any with_*
method.
Trait Implementations
impl Default for RadiusOptions
[src]
fn default() -> RadiusOptions
[src]
impl ToRedisArgs for RadiusOptions
[src]
fn write_redis_args<W: ?Sized>(&self, out: &mut W) where
W: RedisWrite,
[src]
W: RedisWrite,
fn is_single_arg(&self) -> bool
[src]
fn to_redis_args(&self) -> Vec<Vec<u8>>
[src]
fn describe_numeric_behavior(&self) -> NumericBehavior
[src]
Auto Trait Implementations
impl RefUnwindSafe for RadiusOptions
[src]
impl Send for RadiusOptions
[src]
impl Sync for RadiusOptions
[src]
impl Unpin for RadiusOptions
[src]
impl UnwindSafe for RadiusOptions
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,