pub struct SetManager { /* private fields */ }Expand description
Set data structure interface (Redis-compatible)
Set is a collection of unique strings with set algebra operations.
Implementations§
Source§impl SetManager
impl SetManager
Sourcepub async fn rem<K>(&self, key: K, members: Vec<String>) -> Result<usize>
pub async fn rem<K>(&self, key: K, members: Vec<String>) -> Result<usize>
Remove members from set
Sourcepub async fn is_member<K>(&self, key: K, member: String) -> Result<bool>
pub async fn is_member<K>(&self, key: K, member: String) -> Result<bool>
Check if member exists in set
Sourcepub async fn pop<K>(&self, key: K, count: usize) -> Result<Vec<String>>
pub async fn pop<K>(&self, key: K, count: usize) -> Result<Vec<String>>
Remove and return random members
Sourcepub async fn rand_member<K>(&self, key: K, count: usize) -> Result<Vec<String>>
pub async fn rand_member<K>(&self, key: K, count: usize) -> Result<Vec<String>>
Get random members without removing
Sourcepub async fn move<S, D>(
&self,
source: S,
destination: D,
member: String,
) -> Result<bool>
pub async fn move<S, D>( &self, source: S, destination: D, member: String, ) -> Result<bool>
Move member from source to destination set
Sourcepub async fn diff(&self, keys: Vec<String>) -> Result<Vec<String>>
pub async fn diff(&self, keys: Vec<String>) -> Result<Vec<String>>
Get difference of sets (first minus others)
Sourcepub async fn inter_store<D>(
&self,
destination: D,
keys: Vec<String>,
) -> Result<usize>
pub async fn inter_store<D>( &self, destination: D, keys: Vec<String>, ) -> Result<usize>
Store intersection result in destination
Trait Implementations§
Source§impl Clone for SetManager
impl Clone for SetManager
Source§fn clone(&self) -> SetManager
fn clone(&self) -> SetManager
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for SetManager
impl !RefUnwindSafe for SetManager
impl Send for SetManager
impl Sync for SetManager
impl Unpin for SetManager
impl UnsafeUnpin for SetManager
impl !UnwindSafe for SetManager
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
Mutably borrows from an owned value. Read more