pub struct RedisBackend { /* private fields */ }
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§
Source§impl RedisBackend
impl RedisBackend
Sourcepub async fn new() -> Result<RedisBackend, Error>
pub async fn new() -> Result<RedisBackend, Error>
Create new backend instance with default settings.
§Examples
use hitbox_redis::RedisBackend;
#[actix_rt::main]
async fn main() {
let backend = RedisBackend::new().await;
}
Sourcepub fn builder() -> RedisBackendBuilder
pub fn builder() -> RedisBackendBuilder
Creates new RedisBackend builder with default settings.
Trait Implementations§
Source§impl Actor for RedisBackend
Implementation actix Actor trait for Redis cache backend.
impl Actor for RedisBackend
Implementation actix Actor trait for Redis cache backend.
Source§type Context = Context<RedisBackend>
type Context = Context<RedisBackend>
Actor execution context type
Source§fn stopping(&mut self, ctx: &mut Self::Context) -> Running
fn stopping(&mut self, ctx: &mut Self::Context) -> Running
Called after an actor is in
Actor::Stopping
state. Read moreSource§fn start_in_arbiter<F>(arb: &Arbiter, f: F) -> Addr<Self>
fn start_in_arbiter<F>(arb: &Arbiter, f: F) -> Addr<Self>
Start new actor in arbiter’s thread.
Source§impl Backend for RedisBackend
impl Backend for RedisBackend
Source§type Actor = RedisBackend
type Actor = RedisBackend
Type of backend actor bound.
Source§type Context = Context<RedisBackend>
type Context = Context<RedisBackend>
Type for backend Actor context.
Source§impl Handler<Delete> for RedisBackend
Implementation of Actix Handler for Delete message.
impl Handler<Delete> for RedisBackend
Implementation of Actix Handler for Delete message.
Source§impl Handler<Get> for RedisBackend
Implementation of Actix Handler for Get message.
impl Handler<Get> for RedisBackend
Implementation of Actix Handler for Get message.
Source§impl Handler<Lock> for RedisBackend
Implementation of Actix Handler for Lock message.
impl Handler<Lock> for RedisBackend
Implementation of Actix Handler for Lock message.
Source§impl Handler<Set> for RedisBackend
Implementation of Actix Handler for Set message.
impl Handler<Set> for RedisBackend
Implementation of Actix Handler for Set message.
Auto Trait Implementations§
impl Freeze for RedisBackend
impl !RefUnwindSafe for RedisBackend
impl Send for RedisBackend
impl Sync for RedisBackend
impl Unpin for RedisBackend
impl !UnwindSafe for RedisBackend
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