Struct ntex_redis::Client
source · [−]pub struct Client { /* private fields */ }
Expand description
Shared redis client
Implementations
sourceimpl Client
impl Client
sourcepub fn exec<T>(
&self,
cmd: T
) -> impl Future<Output = Result<T::Output, CommandError>> where
T: Command,
pub fn exec<T>(
&self,
cmd: T
) -> impl Future<Output = Result<T::Output, CommandError>> where
T: Command,
Execute redis command
sourcepub async fn flushdb(&self) -> Result<(), Error>
pub async fn flushdb(&self) -> Result<(), Error>
Delete all the keys of the currently selected DB.
sourcepub fn is_connected(&self) -> bool
pub fn is_connected(&self) -> bool
Returns true if underlying transport is connected to redis
Trait Implementations
sourceimpl Service<Request> for Client
impl Service<Request> for Client
type Future = Either<CommandResult, Ready<Response, Error>>
type Future = Either<CommandResult, Ready<Response, Error>>
The future response value.
sourcefn poll_ready(&self, cx: &mut Context<'_>) -> Poll<Result<(), Self::Error>>
fn poll_ready(&self, cx: &mut Context<'_>) -> Poll<Result<(), Self::Error>>
Returns Ready
when the service is able to process requests. Read more
sourcefn call(&self, req: Request) -> Self::Future
fn call(&self, req: Request) -> Self::Future
Process the request and return the response asynchronously. Read more
fn poll_shutdown(&self, ctx: &mut Context<'_>, is_error: bool) -> Poll<()>
fn poll_shutdown(&self, ctx: &mut Context<'_>, is_error: bool) -> Poll<()>
Shutdown service. Read more
Auto Trait Implementations
impl !RefUnwindSafe for Client
impl !Send for Client
impl !Sync for Client
impl Unpin for Client
impl !UnwindSafe for Client
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
impl<T, Req> IntoService<T, Req> for T where
T: Service<Req>,
impl<T, Req> IntoService<T, Req> for T where
T: Service<Req>,
fn into_service(self) -> T
fn into_service(self) -> T
Convert to a Service
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
🔬 This is a nightly-only experimental API. (
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more