use crate::{
commands,
interfaces::{ClientLike, FredResult},
types::FromValue,
};
use fred_macros::rm_send_if;
use futures::Future;
#[rm_send_if(feature = "glommio")]
pub trait SlowlogInterface: ClientLike + Sized {
fn slowlog_get<R>(&self, count: Option<i64>) -> impl Future<Output = FredResult<R>> + Send
where
R: FromValue,
{
async move { commands::slowlog::slowlog_get(self, count).await?.convert() }
}
fn slowlog_length<R>(&self) -> impl Future<Output = FredResult<R>> + Send
where
R: FromValue,
{
async move { commands::slowlog::slowlog_length(self).await?.convert() }
}
fn slowlog_reset(&self) -> impl Future<Output = FredResult<()>> + Send {
async move { commands::slowlog::slowlog_reset(self).await }
}
}