Struct redis_driver::ZRangeStore
source · [−]pub struct ZRangeStore<'a, T>where
T: SortedSetCommands + ?Sized,{ /* private fields */ }
Expand description
Builder for the zrangestore command
Implementations
sourceimpl<'a, T> ZRangeStore<'a, T>where
T: SortedSetCommands + ?Sized,
impl<'a, T> ZRangeStore<'a, T>where
T: SortedSetCommands + ?Sized,
sourcepub fn sort_by(self, sort_by: ZRangeSortBy) -> Self
pub fn sort_by(self, sort_by: ZRangeSortBy) -> Self
When the ByScore
option is provided, the command behaves like ZRANGEBYSCORE
and returns
the range of elements from the sorted set having scores equal or between start
and stop
.
When the ByLex
option is used, the command behaves like ZRANGEBYLEX
and returns the range
of elements from the sorted set between the start
and stop
lexicographical closed range intervals.
sourcepub fn rev(self) -> Self
pub fn rev(self) -> Self
Using the REV option reverses the sorted set, with index 0 as the element with the highest score.
sourcepub fn limit(self, offset: usize, count: isize) -> Self
pub fn limit(self, offset: usize, count: isize) -> Self
The optional LIMIT argument can be used to obtain a sub-range from the matching elements (similar to SELECT LIMIT offset, count in SQL).
A negative count
returns all elements from the offset
.
Keep in mind that if offset
is large, the sorted set needs to be traversed for offset
elements before getting to the elements to return, which can add up to O(N) time complexity.
Auto Trait Implementations
impl<'a, T: ?Sized> RefUnwindSafe for ZRangeStore<'a, T>where
T: RefUnwindSafe,
impl<'a, T: ?Sized> Send for ZRangeStore<'a, T>where
T: Sync,
impl<'a, T: ?Sized> Sync for ZRangeStore<'a, T>where
T: Sync,
impl<'a, T: ?Sized> Unpin for ZRangeStore<'a, T>
impl<'a, T: ?Sized> UnwindSafe for ZRangeStore<'a, T>where
T: RefUnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more