pub struct Commands<'a> { /* private fields */ }Expand description
The group’s commands, run as they are called.
Implementations§
Source§impl Commands<'_>
impl Commands<'_>
Sourcepub async fn smembers<RV: FromRedisValue>(
&self,
key: impl ToRedisArgs,
) -> Result<RV, Error>
pub async fn smembers<RV: FromRedisValue>( &self, key: impl ToRedisArgs, ) -> Result<RV, Error>
Every member.
Sourcepub async fn sismember(
&self,
key: impl ToRedisArgs,
member: impl ToRedisArgs,
) -> Result<bool, Error>
pub async fn sismember( &self, key: impl ToRedisArgs, member: impl ToRedisArgs, ) -> Result<bool, Error>
Whether the value is a member.
Sourcepub async fn smismember(
&self,
key: impl ToRedisArgs,
members: impl ToRedisArgs,
) -> Result<Vec<bool>, Error>
pub async fn smismember( &self, key: impl ToRedisArgs, members: impl ToRedisArgs, ) -> Result<Vec<bool>, Error>
Whether each of the values is a member, in order.
Sourcepub async fn scard(&self, key: impl ToRedisArgs) -> Result<u64, Error>
pub async fn scard(&self, key: impl ToRedisArgs) -> Result<u64, Error>
How many members the set has.
Sourcepub async fn srandmember<RV: FromRedisValue>(
&self,
key: impl ToRedisArgs,
) -> Result<RV, Error>
pub async fn srandmember<RV: FromRedisValue>( &self, key: impl ToRedisArgs, ) -> Result<RV, Error>
A member chosen at random.
Sourcepub async fn srandmember_multiple<RV: FromRedisValue>(
&self,
key: impl ToRedisArgs,
count: isize,
) -> Result<RV, Error>
pub async fn srandmember_multiple<RV: FromRedisValue>( &self, key: impl ToRedisArgs, count: isize, ) -> Result<RV, Error>
count distinct members chosen at random, or with a negative count
that many, possibly repeated.
Sourcepub async fn sdiff<RV: FromRedisValue>(
&self,
keys: impl ToRedisArgs,
) -> Result<RV, Error>
pub async fn sdiff<RV: FromRedisValue>( &self, keys: impl ToRedisArgs, ) -> Result<RV, Error>
The members of the first set that are in none of the others.
Sourcepub async fn sinter<RV: FromRedisValue>(
&self,
keys: impl ToRedisArgs,
) -> Result<RV, Error>
pub async fn sinter<RV: FromRedisValue>( &self, keys: impl ToRedisArgs, ) -> Result<RV, Error>
The members that are in every one of the sets.
Sourcepub async fn sunion<RV: FromRedisValue>(
&self,
keys: impl ToRedisArgs,
) -> Result<RV, Error>
pub async fn sunion<RV: FromRedisValue>( &self, keys: impl ToRedisArgs, ) -> Result<RV, Error>
The members that are in any of the sets.
Sourcepub async fn sadd(
&self,
key: impl ToRedisArgs,
members: impl ToRedisArgs,
) -> Result<u64, Error>
pub async fn sadd( &self, key: impl ToRedisArgs, members: impl ToRedisArgs, ) -> Result<u64, Error>
Adds the members, returning how many are new.
Sourcepub async fn srem(
&self,
key: impl ToRedisArgs,
members: impl ToRedisArgs,
) -> Result<u64, Error>
pub async fn srem( &self, key: impl ToRedisArgs, members: impl ToRedisArgs, ) -> Result<u64, Error>
Removes the members, returning how many there were.
Sourcepub async fn spop<RV: FromRedisValue>(
&self,
key: impl ToRedisArgs,
) -> Result<RV, Error>
pub async fn spop<RV: FromRedisValue>( &self, key: impl ToRedisArgs, ) -> Result<RV, Error>
Removes and returns a member chosen at random.
Sourcepub async fn smove(
&self,
source: impl ToRedisArgs,
destination: impl ToRedisArgs,
member: impl ToRedisArgs,
) -> Result<bool, Error>
pub async fn smove( &self, source: impl ToRedisArgs, destination: impl ToRedisArgs, member: impl ToRedisArgs, ) -> Result<bool, Error>
Moves a member from one set to another. false if it is not in
source.
Sourcepub async fn sdiffstore(
&self,
destination: impl ToRedisArgs,
keys: impl ToRedisArgs,
) -> Result<u64, Error>
pub async fn sdiffstore( &self, destination: impl ToRedisArgs, keys: impl ToRedisArgs, ) -> Result<u64, Error>
Stores Commands::sdiff of the sets at destination, returning its
size.
Sourcepub async fn sinterstore(
&self,
destination: impl ToRedisArgs,
keys: impl ToRedisArgs,
) -> Result<u64, Error>
pub async fn sinterstore( &self, destination: impl ToRedisArgs, keys: impl ToRedisArgs, ) -> Result<u64, Error>
Stores Commands::sinter of the sets at destination, returning its
size.
Sourcepub async fn sunionstore(
&self,
destination: impl ToRedisArgs,
keys: impl ToRedisArgs,
) -> Result<u64, Error>
pub async fn sunionstore( &self, destination: impl ToRedisArgs, keys: impl ToRedisArgs, ) -> Result<u64, Error>
Stores Commands::sunion of the sets at destination, returning its
size.
Source§impl<'a> Commands<'a>
impl<'a> Commands<'a>
Sourcepub fn sscan<T: FromRedisValue>(
&self,
key: impl ToRedisArgs,
options: ScanOptions,
) -> Scan<'a, T>
pub fn sscan<T: FromRedisValue>( &self, key: impl ToRedisArgs, options: ScanOptions, ) -> Scan<'a, T>
Iterates over the set’s members.
Trait Implementations§
Auto Trait Implementations§
impl<'a> !RefUnwindSafe for Commands<'a>
impl<'a> !UnwindSafe for Commands<'a>
impl<'a> Forget for Commands<'a>
impl<'a> Freeze for Commands<'a>
impl<'a> Move for Commands<'a>
impl<'a> Send for Commands<'a>
impl<'a> Sync for Commands<'a>
impl<'a> Unpin for Commands<'a>
impl<'a> UnsafeUnpin for Commands<'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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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