pub struct RedisCli { /* private fields */ }Expand description
Builder for executing redis-cli commands.
Implementations§
Source§impl RedisCli
impl RedisCli
Sourcepub fn unixsocket(self, path: impl Into<PathBuf>) -> Self
pub fn unixsocket(self, path: impl Into<PathBuf>) -> Self
Connect via a Unix socket instead of TCP.
Sourcepub fn cacert(self, path: impl Into<PathBuf>) -> Self
pub fn cacert(self, path: impl Into<PathBuf>) -> Self
Set the CA certificate file for TLS verification.
Sourcepub fn resp(self, protocol: RespProtocol) -> Self
pub fn resp(self, protocol: RespProtocol) -> Self
Set the RESP protocol version.
Sourcepub fn cluster_mode(self, enable: bool) -> Self
pub fn cluster_mode(self, enable: bool) -> Self
Enable cluster mode (-c flag) for following redirects.
Sourcepub fn output_format(self, format: OutputFormat) -> Self
pub fn output_format(self, format: OutputFormat) -> Self
Set the output format.
Sourcepub fn no_auth_warning(self, suppress: bool) -> Self
pub fn no_auth_warning(self, suppress: bool) -> Self
Suppress the AUTH password warning.
Sourcepub async fn run(&self, args: &[&str]) -> Result<String>
pub async fn run(&self, args: &[&str]) -> Result<String>
Run a command and return stdout on success.
Sourcepub fn fire_and_forget(&self, args: &[&str])
pub fn fire_and_forget(&self, args: &[&str])
Run a command, ignoring output. Used for fire-and-forget (SHUTDOWN).
Sourcepub async fn wait_for_ready(&self, timeout: Duration) -> Result<()>
pub async fn wait_for_ready(&self, timeout: Duration) -> Result<()>
Wait until the server responds to PING or timeout expires.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for RedisCli
impl RefUnwindSafe for RedisCli
impl Send for RedisCli
impl Sync for RedisCli
impl Unpin for RedisCli
impl UnsafeUnpin for RedisCli
impl UnwindSafe for RedisCli
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