Module embedded_redis::commands::custom
source · Expand description
Abstraction for arbitrary commands.
CustomCommand in combination with CommandBuilder can be used for executing arbitrary commands, which high level logic is not abstracted yet by this crate.
Response is not evaluated, so pure Resp2Frame or Resp3Frame is returned. The only exception is that error responses are intercepted and converted to CommandErrors::ErrorResponse
Please consider contributing command abstractions not supported yet.
§Basic usage
The following Example demonstrates execution of ECHO command
let mut stack = Stack::default();
let clock = StandardClock::default();
let mut connection_handler = ConnectionHandler::resp2(SocketAddr::from_str("127.0.0.1:6379").unwrap());
let client = connection_handler.connect(&mut stack, Some(&clock)).unwrap();
let command = CommandBuilder::new("ECHO").arg_static("Hello World!").to_command();
let response = client.send(command).unwrap().wait().unwrap();
assert_eq!("Hello World!", response.to_string().unwrap());
Structs§
- Abstraction for arbitrary commands.