pub struct Queue<'a> { /* private fields */ }Expand description
The group’s commands, queued on a pipeline or a transaction.
What each replies is read from exec, in the order queued.
Implementations§
Source§impl Queue<'_>
impl Queue<'_>
Sourcepub fn lrange(
&mut self,
key: impl ToRedisArgs,
start: isize,
stop: isize,
) -> &mut Self
pub fn lrange( &mut self, key: impl ToRedisArgs, start: isize, stop: isize, ) -> &mut Self
The elements from index start to index stop, inclusive. Negative
indexes count from the end: 0, -1 is the whole list.
Sourcepub fn lindex(&mut self, key: impl ToRedisArgs, index: isize) -> &mut Self
pub fn lindex(&mut self, key: impl ToRedisArgs, index: isize) -> &mut Self
The element at an index.
Sourcepub fn llen(&mut self, key: impl ToRedisArgs) -> &mut Self
pub fn llen(&mut self, key: impl ToRedisArgs) -> &mut Self
How many elements the list has.
Sourcepub fn lpos(
&mut self,
key: impl ToRedisArgs,
value: impl ToRedisArgs,
) -> &mut Self
pub fn lpos( &mut self, key: impl ToRedisArgs, value: impl ToRedisArgs, ) -> &mut Self
The index of the first element equal to value.
Sourcepub fn lpush(
&mut self,
key: impl ToRedisArgs,
values: impl ToRedisArgs,
) -> &mut Self
pub fn lpush( &mut self, key: impl ToRedisArgs, values: impl ToRedisArgs, ) -> &mut Self
Prepends the values, returning the list’s new length.
Sourcepub fn rpush(
&mut self,
key: impl ToRedisArgs,
values: impl ToRedisArgs,
) -> &mut Self
pub fn rpush( &mut self, key: impl ToRedisArgs, values: impl ToRedisArgs, ) -> &mut Self
Appends the values, returning the list’s new length.
Sourcepub fn lpush_exists(
&mut self,
key: impl ToRedisArgs,
values: impl ToRedisArgs,
) -> &mut Self
pub fn lpush_exists( &mut self, key: impl ToRedisArgs, values: impl ToRedisArgs, ) -> &mut Self
Prepends the values if the list exists, returning its length.
Sourcepub fn rpush_exists(
&mut self,
key: impl ToRedisArgs,
values: impl ToRedisArgs,
) -> &mut Self
pub fn rpush_exists( &mut self, key: impl ToRedisArgs, values: impl ToRedisArgs, ) -> &mut Self
Appends the values if the list exists, returning its length.
Sourcepub fn lpop(
&mut self,
key: impl ToRedisArgs,
count: Option<NonZeroUsize>,
) -> &mut Self
pub fn lpop( &mut self, key: impl ToRedisArgs, count: Option<NonZeroUsize>, ) -> &mut Self
Removes and returns the first element, or with count that many, as a
list.
Sourcepub fn rpop(
&mut self,
key: impl ToRedisArgs,
count: Option<NonZeroUsize>,
) -> &mut Self
pub fn rpop( &mut self, key: impl ToRedisArgs, count: Option<NonZeroUsize>, ) -> &mut Self
Removes and returns the last element, or with count that many, as a
list.
Sourcepub fn lset(
&mut self,
key: impl ToRedisArgs,
index: isize,
value: impl ToRedisArgs,
) -> &mut Self
pub fn lset( &mut self, key: impl ToRedisArgs, index: isize, value: impl ToRedisArgs, ) -> &mut Self
Replaces the element at an index.
Sourcepub fn ltrim(
&mut self,
key: impl ToRedisArgs,
start: isize,
stop: isize,
) -> &mut Self
pub fn ltrim( &mut self, key: impl ToRedisArgs, start: isize, stop: isize, ) -> &mut Self
Keeps only the elements from index start to index stop, inclusive.
Sourcepub fn linsert_before(
&mut self,
key: impl ToRedisArgs,
pivot: impl ToRedisArgs,
value: impl ToRedisArgs,
) -> &mut Self
pub fn linsert_before( &mut self, key: impl ToRedisArgs, pivot: impl ToRedisArgs, value: impl ToRedisArgs, ) -> &mut Self
Inserts the value before the first element equal to pivot, returning
the list’s new length, or -1 if there is no such element.
Sourcepub fn linsert_after(
&mut self,
key: impl ToRedisArgs,
pivot: impl ToRedisArgs,
value: impl ToRedisArgs,
) -> &mut Self
pub fn linsert_after( &mut self, key: impl ToRedisArgs, pivot: impl ToRedisArgs, value: impl ToRedisArgs, ) -> &mut Self
Inserts the value after the first element equal to pivot, returning
the list’s new length, or -1 if there is no such element.
Sourcepub fn lrem(
&mut self,
key: impl ToRedisArgs,
count: isize,
value: impl ToRedisArgs,
) -> &mut Self
pub fn lrem( &mut self, key: impl ToRedisArgs, count: isize, value: impl ToRedisArgs, ) -> &mut Self
Removes elements equal to value: the first count of them, the last
-count if it is negative, or all if it is 0. Returns how many.
Sourcepub fn lmove(
&mut self,
source: impl ToRedisArgs,
destination: impl ToRedisArgs,
from: Direction,
to: Direction,
) -> &mut Self
pub fn lmove( &mut self, source: impl ToRedisArgs, destination: impl ToRedisArgs, from: Direction, to: Direction, ) -> &mut Self
Moves an element from one end of source to one end of destination,
returning it.
Auto Trait Implementations§
impl<'a> !UnwindSafe for Queue<'a>
impl<'a> Forget for Queue<'a>
impl<'a> Freeze for Queue<'a>
impl<'a> Move for Queue<'a>
impl<'a> RefUnwindSafe for Queue<'a>
impl<'a> Send for Queue<'a>
impl<'a> Sync for Queue<'a>
impl<'a> Unpin for Queue<'a>
impl<'a> UnsafeUnpin for Queue<'a>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
Source§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request