Struct hitbox_actix::RedisBackend [−][src]
pub struct RedisBackend { /* fields omitted */ }
Expand description
Redis cache backend based on redis-rs crate.
This actor provides redis as storage Backend for hitbox. Its use one MultiplexedConnection for asynchronous network interaction.
Implementations
impl RedisBackend
[src]
impl RedisBackend
[src]pub async fn new() -> Result<RedisBackend, Error>
[src]
pub async fn new() -> Result<RedisBackend, Error>
[src]Create new backend instance with default settings.
Examples
use hitbox_redis::RedisBackend; #[actix_rt::main] async fn main() { let backend = RedisBackend::new().await; }
pub fn builder() -> RedisBackendBuilder
[src]
pub fn builder() -> RedisBackendBuilder
[src]Creates new RedisBackend builder with default settings.
Trait Implementations
impl Actor for RedisBackend
[src]
impl Actor for RedisBackend
[src]Implementation actix Actor trait for Redis cache backend.
type Context = Context<RedisBackend>
type Context = Context<RedisBackend>
Actor execution context type
pub fn started(&mut self, &mut <RedisBackend as Actor>::Context)
[src]
pub fn started(&mut self, &mut <RedisBackend as Actor>::Context)
[src]Called when an actor gets polled the first time.
fn stopping(&mut self, ctx: &mut Self::Context) -> Running
[src]
fn stopping(&mut self, ctx: &mut Self::Context) -> Running
[src]Called after an actor is in Actor::Stopping
state. Read more
fn start(self) -> Addr<Self> where
Self: Actor<Context = Context<Self>>,
[src]
fn start(self) -> Addr<Self> where
Self: Actor<Context = Context<Self>>,
[src]Start a new asynchronous actor, returning its address. Read more
fn start_default() -> Addr<Self> where
Self: Actor<Context = Context<Self>> + Default,
[src]
fn start_default() -> Addr<Self> where
Self: Actor<Context = Context<Self>> + Default,
[src]Construct and start a new asynchronous actor, returning its address. Read more
impl Backend for RedisBackend
[src]
impl Backend for RedisBackend
[src]type Actor = RedisBackend
type Actor = RedisBackend
Type of backend actor bound.
type Context = Context<RedisBackend>
type Context = Context<RedisBackend>
Type for backend Actor context.
impl Handler<Delete> for RedisBackend
[src]
impl Handler<Delete> for RedisBackend
[src]Implementation of Actix Handler for Delete message.
type Result = Pin<Box<dyn Future<Output = Result<DeleteStatus, BackendError>> + 'static, Global>>
type Result = Pin<Box<dyn Future<Output = Result<DeleteStatus, BackendError>> + 'static, Global>>
The type of value that this handler will return. Read more
pub fn handle(
&mut self,
msg: Delete,
&mut <RedisBackend as Actor>::Context
) -> <RedisBackend as Handler<Delete>>::Result
[src]
pub fn handle(
&mut self,
msg: Delete,
&mut <RedisBackend as Actor>::Context
) -> <RedisBackend as Handler<Delete>>::Result
[src]This method is called for every message received by this actor.
impl Handler<Get> for RedisBackend
[src]
impl Handler<Get> for RedisBackend
[src]Implementation of Actix Handler for Get message.
type Result = Pin<Box<dyn Future<Output = Result<Option<Vec<u8, Global>>, BackendError>> + 'static, Global>>
type Result = Pin<Box<dyn Future<Output = Result<Option<Vec<u8, Global>>, BackendError>> + 'static, Global>>
The type of value that this handler will return. Read more
pub fn handle(
&mut self,
msg: Get,
&mut <RedisBackend as Actor>::Context
) -> <RedisBackend as Handler<Get>>::Result
[src]
pub fn handle(
&mut self,
msg: Get,
&mut <RedisBackend as Actor>::Context
) -> <RedisBackend as Handler<Get>>::Result
[src]This method is called for every message received by this actor.
impl Handler<Lock> for RedisBackend
[src]
impl Handler<Lock> for RedisBackend
[src]Implementation of Actix Handler for Lock message.
type Result = Pin<Box<dyn Future<Output = Result<LockStatus, BackendError>> + 'static, Global>>
type Result = Pin<Box<dyn Future<Output = Result<LockStatus, BackendError>> + 'static, Global>>
The type of value that this handler will return. Read more
pub fn handle(
&mut self,
msg: Lock,
&mut <RedisBackend as Actor>::Context
) -> <RedisBackend as Handler<Lock>>::Result
[src]
pub fn handle(
&mut self,
msg: Lock,
&mut <RedisBackend as Actor>::Context
) -> <RedisBackend as Handler<Lock>>::Result
[src]This method is called for every message received by this actor.
impl Handler<Set> for RedisBackend
[src]
impl Handler<Set> for RedisBackend
[src]Implementation of Actix Handler for Set message.
type Result = Pin<Box<dyn Future<Output = Result<String, BackendError>> + 'static, Global>>
type Result = Pin<Box<dyn Future<Output = Result<String, BackendError>> + 'static, Global>>
The type of value that this handler will return. Read more
pub fn handle(
&mut self,
msg: Set,
&mut <RedisBackend as Actor>::Context
) -> <RedisBackend as Handler<Set>>::Result
[src]
pub fn handle(
&mut self,
msg: Set,
&mut <RedisBackend as Actor>::Context
) -> <RedisBackend as Handler<Set>>::Result
[src]This method is called for every message received by this actor.
Auto Trait Implementations
impl !RefUnwindSafe for RedisBackend
impl Send for RedisBackend
impl Sync for RedisBackend
impl Unpin for RedisBackend
impl !UnwindSafe for RedisBackend
Blanket Implementations
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]pub fn borrow_mut(&mut self) -> &mut T
[src]
pub fn borrow_mut(&mut self) -> &mut T
[src]Mutably borrows from an owned value. Read more
impl<T> Instrument for T
[src]
impl<T> Instrument for T
[src]fn instrument(self, span: Span) -> Instrumented<Self>
[src]
fn instrument(self, span: Span) -> Instrumented<Self>
[src]Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more
fn in_current_span(self) -> Instrumented<Self>
[src]
fn in_current_span(self) -> Instrumented<Self>
[src]impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,