pub struct RedisServerHandle { /* private fields */ }Expand description
Handle to a running Redis server. Stops the server on Drop.
Implementations§
Source§impl RedisServerHandle
impl RedisServerHandle
Sourcepub async fn run(&self, args: &[&str]) -> Result<String>
pub async fn run(&self, args: &[&str]) -> Result<String>
Run a redis-cli command against this server.
Sourcepub fn stop(&self)
pub fn stop(&self)
Stop the server via an escalating shutdown strategy.
- Sends
SHUTDOWN NOSAVEviaredis-clifor a graceful shutdown. - Waits 500ms for the process to exit.
- If still alive, calls
crate::process::force_kill(SIGTERM then SIGKILL). - Attempts to release the port via
crate::process::kill_by_portas a final safety net.
Sourcepub async fn wait_for_ready(&self, timeout: Duration) -> Result<()>
pub async fn wait_for_ready(&self, timeout: Duration) -> Result<()>
Wait until the server is ready (PING -> PONG).
Trait Implementations§
Auto Trait Implementations§
impl Freeze for RedisServerHandle
impl RefUnwindSafe for RedisServerHandle
impl Send for RedisServerHandle
impl Sync for RedisServerHandle
impl Unpin for RedisServerHandle
impl UnsafeUnpin for RedisServerHandle
impl UnwindSafe for RedisServerHandle
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> 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