Struct redis_driver::ZAdd
source · [−]pub struct ZAdd<'a, T>where
T: SortedSetCommands + ?Sized,{ /* private fields */ }
Implementations
sourceimpl<'a, T> ZAdd<'a, T>where
T: SortedSetCommands + ?Sized,
impl<'a, T> ZAdd<'a, T>where
T: SortedSetCommands + ?Sized,
sourcepub fn execute<M, I>(
self,
items: I
) -> Pin<Box<dyn Future<Output = Result<usize>> + 'a>>where
M: Into<BulkString>,
I: ArgsOrCollection<(f64, M)>,
pub fn execute<M, I>(
self,
items: I
) -> Pin<Box<dyn Future<Output = Result<usize>> + 'a>>where
M: Into<BulkString>,
I: ArgsOrCollection<(f64, M)>,
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).
sourcepub fn lt(self) -> Self
pub fn lt(self) -> Self
Only update existing elements if the new score is less than the current score.
This flag doesn’t prevent adding new elements.
sourcepub fn gt(self) -> Self
pub fn gt(self) -> Self
Only update existing elements if the new score is greater than the current score.
This flag doesn’t prevent adding new elements.
sourcepub fn ch(self) -> Self
pub fn ch(self) -> Self
Modify the return value from the number of new elements added, to the total number of elements changed (CH is an abbreviation of changed).
sourcepub fn incr<M>(
self,
score: f64,
member: M
) -> Pin<Box<dyn Future<Output = Result<Option<f64>>> + 'a>>where
M: Into<BulkString>,
pub fn incr<M>(
self,
score: f64,
member: M
) -> Pin<Box<dyn Future<Output = Result<Option<f64>>> + 'a>>where
M: Into<BulkString>,
When this option is specified ZADD acts like ZINCRBY. Only one score-element pair can be specified in this mode.
Return
The new score of member (a double precision floating point number), or nil if the operation was aborted (when called with either the XX or the NX option).
Auto Trait Implementations
impl<'a, T: ?Sized> RefUnwindSafe for ZAdd<'a, T>where
T: RefUnwindSafe,
impl<'a, T: ?Sized> Send for ZAdd<'a, T>where
T: Sync,
impl<'a, T: ?Sized> Sync for ZAdd<'a, T>where
T: Sync,
impl<'a, T: ?Sized> Unpin for ZAdd<'a, T>
impl<'a, T: ?Sized> UnwindSafe for ZAdd<'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