pub struct CopyOptions<Db: ToString> { /* private fields */ }
Expand description
Options for the COPY command
§Example
use redis::{Commands, RedisResult, CopyOptions, SetExpiry, ExistenceCheck};
fn copy_value(
con: &mut redis::Connection,
old: &str,
new: &str,
) -> RedisResult<Vec<usize>> {
let opts = CopyOptions::default()
.db("my_other_db")
.replace(true);
con.copy(old, new, opts)
}
Implementations§
Trait Implementations§
Source§impl<Db: Clone + ToString> Clone for CopyOptions<Db>
impl<Db: Clone + ToString> Clone for CopyOptions<Db>
Source§fn clone(&self) -> CopyOptions<Db>
fn clone(&self) -> CopyOptions<Db>
Returns a copy 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 moreSource§impl Default for CopyOptions<&'static str>
impl Default for CopyOptions<&'static str>
Source§impl<Db: ToString> ToRedisArgs for CopyOptions<Db>
impl<Db: ToString> ToRedisArgs for CopyOptions<Db>
Source§fn write_redis_args<W>(&self, out: &mut W)where
W: ?Sized + RedisWrite,
fn write_redis_args<W>(&self, out: &mut W)where
W: ?Sized + RedisWrite,
This writes the value into a vector of bytes. Each item
is a single argument. Most items generate a single item. Read more
Source§fn to_redis_args(&self) -> Vec<Vec<u8>>
fn to_redis_args(&self) -> Vec<Vec<u8>>
This converts the value into a vector of bytes. Each item
is a single argument. Most items generate a vector of a
single item. Read more
Source§fn describe_numeric_behavior(&self) -> NumericBehavior
fn describe_numeric_behavior(&self) -> NumericBehavior
Returns an information about the contained value with regards
to it’s numeric behavior in a redis context. This is used in
some high level concepts to switch between different implementations
of redis functions (for instance
INCR
vs INCRBYFLOAT
).Source§fn num_of_args(&self) -> usize
fn num_of_args(&self) -> usize
Returns the number of arguments this value will generate. Read more
impl<Db: Copy + ToString> Copy for CopyOptions<Db>
Auto Trait Implementations§
impl<Db> Freeze for CopyOptions<Db>where
Db: Freeze,
impl<Db> RefUnwindSafe for CopyOptions<Db>where
Db: RefUnwindSafe,
impl<Db> Send for CopyOptions<Db>where
Db: Send,
impl<Db> Sync for CopyOptions<Db>where
Db: Sync,
impl<Db> Unpin for CopyOptions<Db>where
Db: Unpin,
impl<Db> UnwindSafe for CopyOptions<Db>where
Db: UnwindSafe,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
Converts
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>
Converts
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 more