pub trait GenericCommands<'a> {
Show 32 methods
// Provided methods
fn copy<S, D>(
self,
source: S,
destination: D,
destination_db: Option<usize>,
replace: bool,
) -> PreparedCommand<'a, Self, bool>
where Self: Sized,
S: SingleArg,
D: SingleArg { ... }
fn del<K, C>(self, keys: C) -> PreparedCommand<'a, Self, usize>
where Self: Sized,
K: SingleArg,
C: SingleArgCollection<K> { ... }
fn dump<K>(self, key: K) -> PreparedCommand<'a, Self, DumpResult>
where Self: Sized,
K: SingleArg { ... }
fn exists<K, C>(self, keys: C) -> PreparedCommand<'a, Self, usize>
where Self: Sized,
K: SingleArg,
C: SingleArgCollection<K> { ... }
fn expire<K>(
self,
key: K,
seconds: u64,
option: ExpireOption,
) -> PreparedCommand<'a, Self, bool>
where Self: Sized,
K: SingleArg { ... }
fn expireat<K>(
self,
key: K,
unix_time_seconds: u64,
option: ExpireOption,
) -> PreparedCommand<'a, Self, bool>
where Self: Sized,
K: SingleArg { ... }
fn expiretime<K>(self, key: K) -> PreparedCommand<'a, Self, i64>
where Self: Sized,
K: SingleArg { ... }
fn keys<P, K, A>(self, pattern: P) -> PreparedCommand<'a, Self, A>
where Self: Sized,
P: SingleArg,
K: PrimitiveResponse + DeserializeOwned,
A: CollectionResponse<K> + DeserializeOwned { ... }
fn migrate<H, K>(
self,
host: H,
port: u16,
key: K,
destination_db: usize,
timeout: u64,
options: MigrateOptions,
) -> PreparedCommand<'a, Self, MigrateResult>
where Self: Sized,
H: SingleArg,
K: SingleArg { ... }
fn move_<K>(self, key: K, db: usize) -> PreparedCommand<'a, Self, i64>
where Self: Sized,
K: SingleArg { ... }
fn object_encoding<K, E>(self, key: K) -> PreparedCommand<'a, Self, E>
where Self: Sized,
K: SingleArg,
E: PrimitiveResponse { ... }
fn object_freq<K>(self, key: K) -> PreparedCommand<'a, Self, i64>
where Self: Sized,
K: SingleArg { ... }
fn object_idle_time<K>(self, key: K) -> PreparedCommand<'a, Self, i64>
where Self: Sized,
K: SingleArg { ... }
fn object_refcount<K>(self, key: K) -> PreparedCommand<'a, Self, i64>
where Self: Sized,
K: SingleArg { ... }
fn persist<K>(self, key: K) -> PreparedCommand<'a, Self, bool>
where Self: Sized,
K: SingleArg { ... }
fn pexpire<K>(
self,
key: K,
milliseconds: u64,
option: ExpireOption,
) -> PreparedCommand<'a, Self, bool>
where Self: Sized,
K: SingleArg { ... }
fn pexpireat<K>(
self,
key: K,
unix_time_milliseconds: u64,
option: ExpireOption,
) -> PreparedCommand<'a, Self, bool>
where Self: Sized,
K: SingleArg { ... }
fn pexpiretime<K>(self, key: K) -> PreparedCommand<'a, Self, i64>
where Self: Sized,
K: SingleArg { ... }
fn pttl<K>(self, key: K) -> PreparedCommand<'a, Self, i64>
where Self: Sized,
K: SingleArg { ... }
fn randomkey<R>(self) -> PreparedCommand<'a, Self, R>
where Self: Sized,
R: PrimitiveResponse { ... }
fn rename<K1, K2>(
self,
key: K1,
new_key: K2,
) -> PreparedCommand<'a, Self, ()>
where Self: Sized,
K1: SingleArg,
K2: SingleArg { ... }
fn renamenx<K1, K2>(
self,
key: K1,
new_key: K2,
) -> PreparedCommand<'a, Self, bool>
where Self: Sized,
K1: SingleArg,
K2: SingleArg { ... }
fn restore<K>(
self,
key: K,
ttl: u64,
serialized_value: Vec<u8>,
options: RestoreOptions,
) -> PreparedCommand<'a, Self, ()>
where Self: Sized,
K: SingleArg { ... }
fn scan<K, A>(
self,
cursor: u64,
options: ScanOptions,
) -> PreparedCommand<'a, Self, (u64, A)>
where Self: Sized,
K: PrimitiveResponse + DeserializeOwned,
A: CollectionResponse<K> + DeserializeOwned { ... }
fn sort<K, M, A>(
self,
key: K,
options: SortOptions,
) -> PreparedCommand<'a, Self, A>
where Self: Sized,
K: SingleArg,
M: PrimitiveResponse + DeserializeOwned,
A: CollectionResponse<M> + DeserializeOwned { ... }
fn sort_and_store<K, D>(
self,
key: K,
destination: D,
options: SortOptions,
) -> PreparedCommand<'a, Self, usize>
where Self: Sized,
K: SingleArg,
D: SingleArg { ... }
fn sort_readonly<K, M, A>(
self,
key: K,
options: SortOptions,
) -> PreparedCommand<'a, Self, A>
where Self: Sized,
K: SingleArg,
M: PrimitiveResponse + DeserializeOwned,
A: CollectionResponse<M> + DeserializeOwned { ... }
fn touch<K, KK>(self, keys: KK) -> PreparedCommand<'a, Self, usize>
where Self: Sized,
K: SingleArg,
KK: SingleArgCollection<K> { ... }
fn ttl<K>(self, key: K) -> PreparedCommand<'a, Self, i64>
where Self: Sized,
K: SingleArg { ... }
fn type_<K>(self, key: K) -> PreparedCommand<'a, Self, String>
where Self: Sized,
K: SingleArg { ... }
fn unlink<K, C>(self, keys: C) -> PreparedCommand<'a, Self, usize>
where Self: Sized,
K: SingleArg,
C: SingleArgCollection<K> { ... }
fn wait(
self,
num_replicas: usize,
timeout: u64,
) -> PreparedCommand<'a, Self, usize>
where Self: Sized { ... }
}
Expand description
Provided Methods§
Sourcefn copy<S, D>(
self,
source: S,
destination: D,
destination_db: Option<usize>,
replace: bool,
) -> PreparedCommand<'a, Self, bool>
fn copy<S, D>( self, source: S, destination: D, destination_db: Option<usize>, replace: bool, ) -> PreparedCommand<'a, Self, bool>
Sourcefn del<K, C>(self, keys: C) -> PreparedCommand<'a, Self, usize>
fn del<K, C>(self, keys: C) -> PreparedCommand<'a, Self, usize>
Sourcefn dump<K>(self, key: K) -> PreparedCommand<'a, Self, DumpResult>
fn dump<K>(self, key: K) -> PreparedCommand<'a, Self, DumpResult>
Sourcefn exists<K, C>(self, keys: C) -> PreparedCommand<'a, Self, usize>
fn exists<K, C>(self, keys: C) -> PreparedCommand<'a, Self, usize>
Sourcefn expire<K>(
self,
key: K,
seconds: u64,
option: ExpireOption,
) -> PreparedCommand<'a, Self, bool>
fn expire<K>( self, key: K, seconds: u64, option: ExpireOption, ) -> PreparedCommand<'a, Self, bool>
Sourcefn expireat<K>(
self,
key: K,
unix_time_seconds: u64,
option: ExpireOption,
) -> PreparedCommand<'a, Self, bool>
fn expireat<K>( self, key: K, unix_time_seconds: u64, option: ExpireOption, ) -> PreparedCommand<'a, 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>(self, key: K) -> PreparedCommand<'a, Self, i64>
fn expiretime<K>(self, key: K) -> PreparedCommand<'a, 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>(self, pattern: P) -> PreparedCommand<'a, Self, A>where
Self: Sized,
P: SingleArg,
K: PrimitiveResponse + DeserializeOwned,
A: CollectionResponse<K> + DeserializeOwned,
fn keys<P, K, A>(self, pattern: P) -> PreparedCommand<'a, Self, A>where
Self: Sized,
P: SingleArg,
K: PrimitiveResponse + DeserializeOwned,
A: CollectionResponse<K> + DeserializeOwned,
Sourcefn migrate<H, K>(
self,
host: H,
port: u16,
key: K,
destination_db: usize,
timeout: u64,
options: MigrateOptions,
) -> PreparedCommand<'a, Self, MigrateResult>
fn migrate<H, K>( self, host: H, port: u16, key: K, destination_db: usize, timeout: u64, options: MigrateOptions, ) -> PreparedCommand<'a, Self, MigrateResult>
Sourcefn move_<K>(self, key: K, db: usize) -> PreparedCommand<'a, Self, i64>
fn move_<K>(self, key: K, db: usize) -> PreparedCommand<'a, Self, i64>
Sourcefn object_encoding<K, E>(self, key: K) -> PreparedCommand<'a, Self, E>
fn object_encoding<K, E>(self, key: K) -> PreparedCommand<'a, Self, E>
Sourcefn object_freq<K>(self, key: K) -> PreparedCommand<'a, Self, i64>
fn object_freq<K>(self, key: K) -> PreparedCommand<'a, Self, i64>
Sourcefn object_idle_time<K>(self, key: K) -> PreparedCommand<'a, Self, i64>
fn object_idle_time<K>(self, key: K) -> PreparedCommand<'a, Self, i64>
Sourcefn object_refcount<K>(self, key: K) -> PreparedCommand<'a, Self, i64>
fn object_refcount<K>(self, key: K) -> PreparedCommand<'a, Self, i64>
Sourcefn persist<K>(self, key: K) -> PreparedCommand<'a, Self, bool>
fn persist<K>(self, key: K) -> PreparedCommand<'a, Self, bool>
Sourcefn pexpire<K>(
self,
key: K,
milliseconds: u64,
option: ExpireOption,
) -> PreparedCommand<'a, Self, bool>
fn pexpire<K>( self, key: K, milliseconds: u64, option: ExpireOption, ) -> PreparedCommand<'a, Self, bool>
Sourcefn pexpireat<K>(
self,
key: K,
unix_time_milliseconds: u64,
option: ExpireOption,
) -> PreparedCommand<'a, Self, bool>
fn pexpireat<K>( self, key: K, unix_time_milliseconds: u64, option: ExpireOption, ) -> PreparedCommand<'a, 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>(self, key: K) -> PreparedCommand<'a, Self, i64>
fn pexpiretime<K>(self, key: K) -> PreparedCommand<'a, 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.