Trait redis_driver::GenericCommands
source · pub trait GenericCommands {
Show 32 methods
fn copy<S, D>(
&mut self,
source: S,
destination: D,
destination_db: Option<usize>,
replace: bool
) -> PreparedCommand<'_, Self, bool>
where
Self: Sized,
S: Into<BulkString>,
D: Into<BulkString>,
{ ... }
fn del<K, C>(&mut self, keys: C) -> PreparedCommand<'_, Self, usize>
where
Self: Sized,
K: Into<BulkString>,
C: SingleArgOrCollection<K>,
{ ... }
fn dump<K>(&mut self, key: K) -> PreparedCommand<'_, Self, DumpResult>
where
Self: Sized,
K: Into<BulkString>,
{ ... }
fn exists<K, C>(&mut self, keys: C) -> PreparedCommand<'_, Self, usize>
where
Self: Sized,
K: Into<BulkString>,
C: SingleArgOrCollection<K>,
{ ... }
fn expire<K>(
&mut self,
key: K,
seconds: u64,
option: ExpireOption
) -> PreparedCommand<'_, Self, bool>
where
Self: Sized,
K: Into<BulkString>,
{ ... }
fn expireat<K>(
&mut self,
key: K,
unix_time_seconds: u64,
option: ExpireOption
) -> PreparedCommand<'_, Self, bool>
where
Self: Sized,
K: Into<BulkString>,
{ ... }
fn expiretime<K>(&mut self, key: K) -> PreparedCommand<'_, Self, i64>
where
Self: Sized,
K: Into<BulkString>,
{ ... }
fn keys<P, K, A>(&mut self, pattern: P) -> PreparedCommand<'_, Self, A>
where
Self: Sized,
P: Into<BulkString>,
K: FromValue,
A: FromSingleValueArray<K>,
{ ... }
fn migrate<H, K>(
&mut self,
host: H,
port: u16,
key: K,
destination_db: usize,
timeout: u64,
options: MigrateOptions
) -> PreparedCommand<'_, Self, MigrateResult>
where
Self: Sized,
H: Into<BulkString>,
K: Into<BulkString>,
{ ... }
fn move_<K>(&mut self, key: K, db: usize) -> PreparedCommand<'_, Self, i64>
where
Self: Sized,
K: Into<BulkString>,
{ ... }
fn object_encoding<K, E>(&mut self, key: K) -> PreparedCommand<'_, Self, E>
where
Self: Sized,
K: Into<BulkString>,
E: FromValue,
{ ... }
fn object_freq<K>(&mut self, key: K) -> PreparedCommand<'_, Self, i64>
where
Self: Sized,
K: Into<BulkString>,
{ ... }
fn object_idle_time<K>(&mut self, key: K) -> PreparedCommand<'_, Self, i64>
where
Self: Sized,
K: Into<BulkString>,
{ ... }
fn object_refcount<K>(&mut self, key: K) -> PreparedCommand<'_, Self, i64>
where
Self: Sized,
K: Into<BulkString>,
{ ... }
fn persist<K>(&mut self, key: K) -> PreparedCommand<'_, Self, bool>
where
Self: Sized,
K: Into<BulkString>,
{ ... }
fn pexpire<K>(
&mut self,
key: K,
milliseconds: u64,
option: ExpireOption
) -> PreparedCommand<'_, Self, bool>
where
Self: Sized,
K: Into<BulkString>,
{ ... }
fn pexpireat<K>(
&mut self,
key: K,
unix_time_milliseconds: u64,
option: ExpireOption
) -> PreparedCommand<'_, Self, bool>
where
Self: Sized,
K: Into<BulkString>,
{ ... }
fn pexpiretime<K>(&mut self, key: K) -> PreparedCommand<'_, Self, i64>
where
Self: Sized,
K: Into<BulkString>,
{ ... }
fn pttl<K>(&mut self, key: K) -> PreparedCommand<'_, Self, i64>
where
Self: Sized,
K: Into<BulkString>,
{ ... }
fn randomkey<R>(&mut self) -> PreparedCommand<'_, Self, R>
where
Self: Sized,
R: FromValue,
{ ... }
fn rename<K1, K2>(
&mut self,
key: K1,
new_key: K2
) -> PreparedCommand<'_, Self, ()>
where
Self: Sized,
K1: Into<BulkString>,
K2: Into<BulkString>,
{ ... }
fn renamenx<K1, K2>(
&mut self,
key: K1,
new_key: K2
) -> PreparedCommand<'_, Self, bool>
where
Self: Sized,
K1: Into<BulkString>,
K2: Into<BulkString>,
{ ... }
fn restore<K>(
&mut self,
key: K,
ttl: u64,
serialized_value: Vec<u8>,
options: RestoreOptions
) -> PreparedCommand<'_, Self, ()>
where
Self: Sized,
K: Into<BulkString>,
{ ... }
fn scan<K, A>(
&mut self,
cursor: u64,
options: ScanOptions
) -> PreparedCommand<'_, Self, (u64, A)>
where
Self: Sized,
K: FromValue,
A: FromSingleValueArray<K>,
{ ... }
fn sort<K, M, A>(
&mut self,
key: K,
options: SortOptions
) -> PreparedCommand<'_, Self, A>
where
Self: Sized,
K: Into<BulkString>,
M: FromValue,
A: FromSingleValueArray<M>,
{ ... }
fn sort_and_store<K, D>(
&mut self,
key: K,
destination: D,
options: SortOptions
) -> PreparedCommand<'_, Self, usize>
where
Self: Sized,
K: Into<BulkString>,
D: Into<BulkString>,
{ ... }
fn sort_readonly<K, M, A>(
&mut self,
key: K,
options: SortOptions
) -> PreparedCommand<'_, Self, A>
where
Self: Sized,
K: Into<BulkString>,
M: FromValue,
A: FromSingleValueArray<M>,
{ ... }
fn touch<K, KK>(&mut self, keys: KK) -> PreparedCommand<'_, Self, usize>
where
Self: Sized,
K: Into<BulkString>,
KK: SingleArgOrCollection<K>,
{ ... }
fn ttl<K>(&mut self, key: K) -> PreparedCommand<'_, Self, i64>
where
Self: Sized,
K: Into<BulkString>,
{ ... }
fn type_<K>(&mut self, key: K) -> PreparedCommand<'_, Self, String>
where
Self: Sized,
K: Into<BulkString>,
{ ... }
fn unlink<K, C>(&mut self, keys: C) -> PreparedCommand<'_, Self, usize>
where
Self: Sized,
K: Into<BulkString>,
C: SingleArgOrCollection<K>,
{ ... }
fn wait(
&mut self,
num_replicas: usize,
timeout: u64
) -> PreparedCommand<'_, Self, usize>
where
Self: Sized,
{ ... }
}
Expand description
Provided Methods
sourcefn copy<S, D>(
&mut self,
source: S,
destination: D,
destination_db: Option<usize>,
replace: bool
) -> PreparedCommand<'_, Self, bool>where
Self: Sized,
S: Into<BulkString>,
D: Into<BulkString>,
fn copy<S, D>(
&mut self,
source: S,
destination: D,
destination_db: Option<usize>,
replace: bool
) -> PreparedCommand<'_, Self, bool>where
Self: Sized,
S: Into<BulkString>,
D: Into<BulkString>,
sourcefn del<K, C>(&mut self, keys: C) -> PreparedCommand<'_, Self, usize>where
Self: Sized,
K: Into<BulkString>,
C: SingleArgOrCollection<K>,
fn del<K, C>(&mut self, keys: C) -> PreparedCommand<'_, Self, usize>where
Self: Sized,
K: Into<BulkString>,
C: SingleArgOrCollection<K>,
sourcefn dump<K>(&mut self, key: K) -> PreparedCommand<'_, Self, DumpResult>where
Self: Sized,
K: Into<BulkString>,
fn dump<K>(&mut self, key: K) -> PreparedCommand<'_, Self, DumpResult>where
Self: Sized,
K: Into<BulkString>,
sourcefn exists<K, C>(&mut self, keys: C) -> PreparedCommand<'_, Self, usize>where
Self: Sized,
K: Into<BulkString>,
C: SingleArgOrCollection<K>,
fn exists<K, C>(&mut self, keys: C) -> PreparedCommand<'_, Self, usize>where
Self: Sized,
K: Into<BulkString>,
C: SingleArgOrCollection<K>,
sourcefn expire<K>(
&mut self,
key: K,
seconds: u64,
option: ExpireOption
) -> PreparedCommand<'_, Self, bool>where
Self: Sized,
K: Into<BulkString>,
fn expire<K>(
&mut self,
key: K,
seconds: u64,
option: ExpireOption
) -> PreparedCommand<'_, Self, bool>where
Self: Sized,
K: Into<BulkString>,
sourcefn expireat<K>(
&mut self,
key: K,
unix_time_seconds: u64,
option: ExpireOption
) -> PreparedCommand<'_, Self, bool>where
Self: Sized,
K: Into<BulkString>,
fn expireat<K>(
&mut self,
key: K,
unix_time_seconds: u64,
option: ExpireOption
) -> PreparedCommand<'_, Self, bool>where
Self: Sized,
K: Into<BulkString>,
EXPIREAT has the same effect and semantic as EXPIRE, but instead of specifying the number of seconds representing the TTL (time to live), it takes an absolute Unix timestamp (seconds since January 1, 1970)
A timestamp in the past will delete the key
Return
true
- if the timeout was set.false
- if the timeout was not set. e.g. key doesn’t exist, or operation skipped due to the provided arguments.
See Also
sourcefn expiretime<K>(&mut self, key: K) -> PreparedCommand<'_, Self, i64>where
Self: Sized,
K: Into<BulkString>,
fn expiretime<K>(&mut self, key: K) -> PreparedCommand<'_, Self, i64>where
Self: Sized,
K: Into<BulkString>,
Returns the absolute Unix timestamp (since January 1, 1970) in seconds at which the given key will expire.
Return
Expiration Unix timestamp in seconds, or a negative value in order to signal an error (see the description below).
- The command returns -1 if the key exists but has no associated expiration time.
- The command returns -2 if the key does not exist.
See Also
sourcefn keys<P, K, A>(&mut self, pattern: P) -> PreparedCommand<'_, Self, A>where
Self: Sized,
P: Into<BulkString>,
K: FromValue,
A: FromSingleValueArray<K>,
fn keys<P, K, A>(&mut self, pattern: P) -> PreparedCommand<'_, Self, A>where
Self: Sized,
P: Into<BulkString>,
K: FromValue,
A: FromSingleValueArray<K>,
sourcefn migrate<H, K>(
&mut self,
host: H,
port: u16,
key: K,
destination_db: usize,
timeout: u64,
options: MigrateOptions
) -> PreparedCommand<'_, Self, MigrateResult>where
Self: Sized,
H: Into<BulkString>,
K: Into<BulkString>,
fn migrate<H, K>(
&mut self,
host: H,
port: u16,
key: K,
destination_db: usize,
timeout: u64,
options: MigrateOptions
) -> PreparedCommand<'_, Self, MigrateResult>where
Self: Sized,
H: Into<BulkString>,
K: Into<BulkString>,
sourcefn move_<K>(&mut self, key: K, db: usize) -> PreparedCommand<'_, Self, i64>where
Self: Sized,
K: Into<BulkString>,
fn move_<K>(&mut self, key: K, db: usize) -> PreparedCommand<'_, Self, i64>where
Self: Sized,
K: Into<BulkString>,
sourcefn object_encoding<K, E>(&mut self, key: K) -> PreparedCommand<'_, Self, E>where
Self: Sized,
K: Into<BulkString>,
E: FromValue,
fn object_encoding<K, E>(&mut self, key: K) -> PreparedCommand<'_, Self, E>where
Self: Sized,
K: Into<BulkString>,
E: FromValue,
sourcefn object_freq<K>(&mut self, key: K) -> PreparedCommand<'_, Self, i64>where
Self: Sized,
K: Into<BulkString>,
fn object_freq<K>(&mut self, key: K) -> PreparedCommand<'_, Self, i64>where
Self: Sized,
K: Into<BulkString>,
sourcefn object_idle_time<K>(&mut self, key: K) -> PreparedCommand<'_, Self, i64>where
Self: Sized,
K: Into<BulkString>,
fn object_idle_time<K>(&mut self, key: K) -> PreparedCommand<'_, Self, i64>where
Self: Sized,
K: Into<BulkString>,
sourcefn object_refcount<K>(&mut self, key: K) -> PreparedCommand<'_, Self, i64>where
Self: Sized,
K: Into<BulkString>,
fn object_refcount<K>(&mut self, key: K) -> PreparedCommand<'_, Self, i64>where
Self: Sized,
K: Into<BulkString>,
sourcefn persist<K>(&mut self, key: K) -> PreparedCommand<'_, Self, bool>where
Self: Sized,
K: Into<BulkString>,
fn persist<K>(&mut self, key: K) -> PreparedCommand<'_, Self, bool>where
Self: Sized,
K: Into<BulkString>,
sourcefn pexpire<K>(
&mut self,
key: K,
milliseconds: u64,
option: ExpireOption
) -> PreparedCommand<'_, Self, bool>where
Self: Sized,
K: Into<BulkString>,
fn pexpire<K>(
&mut self,
key: K,
milliseconds: u64,
option: ExpireOption
) -> PreparedCommand<'_, Self, bool>where
Self: Sized,
K: Into<BulkString>,
sourcefn pexpireat<K>(
&mut self,
key: K,
unix_time_milliseconds: u64,
option: ExpireOption
) -> PreparedCommand<'_, Self, bool>where
Self: Sized,
K: Into<BulkString>,
fn pexpireat<K>(
&mut self,
key: K,
unix_time_milliseconds: u64,
option: ExpireOption
) -> PreparedCommand<'_, Self, bool>where
Self: Sized,
K: Into<BulkString>,
PEXPIREAT has the same effect and semantic as EXPIREAT, but the Unix time at which the key will expire is specified in milliseconds instead of seconds.
Return
true
- if the timeout was set.false
- if the timeout was not set. e.g. key doesn’t exist, or operation skipped due to the provided arguments.
See Also
sourcefn pexpiretime<K>(&mut self, key: K) -> PreparedCommand<'_, Self, i64>where
Self: Sized,
K: Into<BulkString>,
fn pexpiretime<K>(&mut self, key: K) -> PreparedCommand<'_, Self, i64>where
Self: Sized,
K: Into<BulkString>,
PEXPIRETIME has the same semantic as EXPIRETIME, but returns the absolute Unix expiration timestamp in milliseconds instead of seconds.
Return
Expiration Unix timestamp in milliseconds, or a negative value in order to signal an error (see the description below).
- The command returns -1 if the key exists but has no associated expiration time.
- The command returns -2 if the key does not exist.