pub trait GenericCommands {
Show 32 methods
// Provided 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<CommandArg>,
D: Into<CommandArg> { ... }
fn del<K, C>(&mut self, keys: C) -> PreparedCommand<'_, Self, usize>
where Self: Sized,
K: Into<CommandArg>,
C: SingleArgOrCollection<K> { ... }
fn dump<K>(&mut self, key: K) -> PreparedCommand<'_, Self, DumpResult>
where Self: Sized,
K: Into<CommandArg> { ... }
fn exists<K, C>(&mut self, keys: C) -> PreparedCommand<'_, Self, usize>
where Self: Sized,
K: Into<CommandArg>,
C: SingleArgOrCollection<K> { ... }
fn expire<K>(
&mut self,
key: K,
seconds: u64,
option: ExpireOption,
) -> PreparedCommand<'_, Self, bool>
where Self: Sized,
K: Into<CommandArg> { ... }
fn expireat<K>(
&mut self,
key: K,
unix_time_seconds: u64,
option: ExpireOption,
) -> PreparedCommand<'_, Self, bool>
where Self: Sized,
K: Into<CommandArg> { ... }
fn expiretime<K>(&mut self, key: K) -> PreparedCommand<'_, Self, i64>
where Self: Sized,
K: Into<CommandArg> { ... }
fn keys<P, K, A>(&mut self, pattern: P) -> PreparedCommand<'_, Self, A>
where Self: Sized,
P: Into<CommandArg>,
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<CommandArg>,
K: Into<CommandArg> { ... }
fn move_<K>(&mut self, key: K, db: usize) -> PreparedCommand<'_, Self, i64>
where Self: Sized,
K: Into<CommandArg> { ... }
fn object_encoding<K, E>(&mut self, key: K) -> PreparedCommand<'_, Self, E>
where Self: Sized,
K: Into<CommandArg>,
E: FromValue { ... }
fn object_freq<K>(&mut self, key: K) -> PreparedCommand<'_, Self, i64>
where Self: Sized,
K: Into<CommandArg> { ... }
fn object_idle_time<K>(&mut self, key: K) -> PreparedCommand<'_, Self, i64>
where Self: Sized,
K: Into<CommandArg> { ... }
fn object_refcount<K>(&mut self, key: K) -> PreparedCommand<'_, Self, i64>
where Self: Sized,
K: Into<CommandArg> { ... }
fn persist<K>(&mut self, key: K) -> PreparedCommand<'_, Self, bool>
where Self: Sized,
K: Into<CommandArg> { ... }
fn pexpire<K>(
&mut self,
key: K,
milliseconds: u64,
option: ExpireOption,
) -> PreparedCommand<'_, Self, bool>
where Self: Sized,
K: Into<CommandArg> { ... }
fn pexpireat<K>(
&mut self,
key: K,
unix_time_milliseconds: u64,
option: ExpireOption,
) -> PreparedCommand<'_, Self, bool>
where Self: Sized,
K: Into<CommandArg> { ... }
fn pexpiretime<K>(&mut self, key: K) -> PreparedCommand<'_, Self, i64>
where Self: Sized,
K: Into<CommandArg> { ... }
fn pttl<K>(&mut self, key: K) -> PreparedCommand<'_, Self, i64>
where Self: Sized,
K: Into<CommandArg> { ... }
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<CommandArg>,
K2: Into<CommandArg> { ... }
fn renamenx<K1, K2>(
&mut self,
key: K1,
new_key: K2,
) -> PreparedCommand<'_, Self, bool>
where Self: Sized,
K1: Into<CommandArg>,
K2: Into<CommandArg> { ... }
fn restore<K>(
&mut self,
key: K,
ttl: u64,
serialized_value: Vec<u8>,
options: RestoreOptions,
) -> PreparedCommand<'_, Self, ()>
where Self: Sized,
K: Into<CommandArg> { ... }
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<CommandArg>,
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<CommandArg>,
D: Into<CommandArg> { ... }
fn sort_readonly<K, M, A>(
&mut self,
key: K,
options: SortOptions,
) -> PreparedCommand<'_, Self, A>
where Self: Sized,
K: Into<CommandArg>,
M: FromValue,
A: FromSingleValueArray<M> { ... }
fn touch<K, KK>(&mut self, keys: KK) -> PreparedCommand<'_, Self, usize>
where Self: Sized,
K: Into<CommandArg>,
KK: SingleArgOrCollection<K> { ... }
fn ttl<K>(&mut self, key: K) -> PreparedCommand<'_, Self, i64>
where Self: Sized,
K: Into<CommandArg> { ... }
fn type_<K>(&mut self, key: K) -> PreparedCommand<'_, Self, String>
where Self: Sized,
K: Into<CommandArg> { ... }
fn unlink<K, C>(&mut self, keys: C) -> PreparedCommand<'_, Self, usize>
where Self: Sized,
K: Into<CommandArg>,
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>
fn copy<S, D>( &mut self, source: S, destination: D, destination_db: Option<usize>, replace: bool, ) -> PreparedCommand<'_, Self, bool>
Sourcefn del<K, C>(&mut self, keys: C) -> PreparedCommand<'_, Self, usize>
fn del<K, C>(&mut self, keys: C) -> PreparedCommand<'_, Self, usize>
Sourcefn dump<K>(&mut self, key: K) -> PreparedCommand<'_, Self, DumpResult>
fn dump<K>(&mut self, key: K) -> PreparedCommand<'_, Self, DumpResult>
Sourcefn exists<K, C>(&mut self, keys: C) -> PreparedCommand<'_, Self, usize>
fn exists<K, C>(&mut self, keys: C) -> PreparedCommand<'_, Self, usize>
Sourcefn expire<K>(
&mut self,
key: K,
seconds: u64,
option: ExpireOption,
) -> PreparedCommand<'_, Self, bool>
fn expire<K>( &mut self, key: K, seconds: u64, option: ExpireOption, ) -> PreparedCommand<'_, Self, bool>
Sourcefn expireat<K>(
&mut self,
key: K,
unix_time_seconds: u64,
option: ExpireOption,
) -> PreparedCommand<'_, Self, bool>
fn expireat<K>( &mut self, key: K, unix_time_seconds: u64, option: ExpireOption, ) -> PreparedCommand<'_, Self, bool>
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>
fn expiretime<K>(&mut self, key: K) -> PreparedCommand<'_, Self, i64>
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>
fn keys<P, K, A>(&mut self, pattern: P) -> PreparedCommand<'_, Self, A>
Sourcefn migrate<H, K>(
&mut self,
host: H,
port: u16,
key: K,
destination_db: usize,
timeout: u64,
options: MigrateOptions,
) -> PreparedCommand<'_, Self, MigrateResult>
fn migrate<H, K>( &mut self, host: H, port: u16, key: K, destination_db: usize, timeout: u64, options: MigrateOptions, ) -> PreparedCommand<'_, Self, MigrateResult>
Sourcefn move_<K>(&mut self, key: K, db: usize) -> PreparedCommand<'_, Self, i64>
fn move_<K>(&mut self, key: K, db: usize) -> PreparedCommand<'_, Self, i64>
Sourcefn object_encoding<K, E>(&mut self, key: K) -> PreparedCommand<'_, Self, E>
fn object_encoding<K, E>(&mut self, key: K) -> PreparedCommand<'_, Self, E>
Sourcefn object_freq<K>(&mut self, key: K) -> PreparedCommand<'_, Self, i64>
fn object_freq<K>(&mut self, key: K) -> PreparedCommand<'_, Self, i64>
Sourcefn object_idle_time<K>(&mut self, key: K) -> PreparedCommand<'_, Self, i64>
fn object_idle_time<K>(&mut self, key: K) -> PreparedCommand<'_, Self, i64>
Sourcefn object_refcount<K>(&mut self, key: K) -> PreparedCommand<'_, Self, i64>
fn object_refcount<K>(&mut self, key: K) -> PreparedCommand<'_, Self, i64>
Sourcefn persist<K>(&mut self, key: K) -> PreparedCommand<'_, Self, bool>
fn persist<K>(&mut self, key: K) -> PreparedCommand<'_, Self, bool>
Sourcefn pexpire<K>(
&mut self,
key: K,
milliseconds: u64,
option: ExpireOption,
) -> PreparedCommand<'_, Self, bool>
fn pexpire<K>( &mut self, key: K, milliseconds: u64, option: ExpireOption, ) -> PreparedCommand<'_, Self, bool>
Sourcefn pexpireat<K>(
&mut self,
key: K,
unix_time_milliseconds: u64,
option: ExpireOption,
) -> PreparedCommand<'_, Self, bool>
fn pexpireat<K>( &mut self, key: K, unix_time_milliseconds: u64, option: ExpireOption, ) -> PreparedCommand<'_, Self, bool>
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>
fn pexpiretime<K>(&mut self, key: K) -> PreparedCommand<'_, Self, i64>
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.