pub struct Command {
pub name: &'static str,
pub args: CommandArgs,
/* private fields */
}
Expand description
Generic command meant to be sent to the Redis Server
Fields§
§name: &'static str
Name of the command.
Note: Sub commands are expressed as the first argument of the command.
e.g. cmd("CONFIG").arg("SET").arg("hash-max-listpack-entries").arg("1024")
args: CommandArgs
Collection of arguments of the command.
Implementations§
Source§impl Command
impl Command
Sourcepub fn new(name: &'static str) -> Self
pub fn new(name: &'static str) -> Self
Creates an new command.
cmd
function can be used as a shortcut.
Sourcepub fn arg<A>(self, arg: A) -> Selfwhere
A: ToArgs,
pub fn arg<A>(self, arg: A) -> Selfwhere
A: ToArgs,
Builder function to add an argument to an existing command.
Sourcepub fn arg_if<A>(self, condition: bool, arg: A) -> Selfwhere
A: ToArgs,
pub fn arg_if<A>(self, condition: bool, arg: A) -> Selfwhere
A: ToArgs,
Builder function to add an argument to an existing command, only if a condition is true
.
pub fn kill_connection_on_write(self, num_kills: usize) -> Self
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Command
impl RefUnwindSafe for Command
impl Send for Command
impl Sync for Command
impl Unpin for Command
impl UnwindSafe for Command
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