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 started(&mut self, _: &mut <RedisBackend as Actor>::Context)
fn started(&mut self, _: &mut <RedisBackend as Actor>::Context)
Called when an actor gets polled the first time.
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_default() -> Addr<Self>
fn start_default() -> Addr<Self>
Construct and start a new asynchronous actor, returning its
address. Read more
Source§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§type Result = Pin<Box<dyn Future<Output = Result<DeleteStatus, BackendError>>>>
type Result = Pin<Box<dyn Future<Output = Result<DeleteStatus, BackendError>>>>
The type of value that this handler will return. Read more
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§type Result = Pin<Box<dyn Future<Output = Result<LockStatus, BackendError>>>>
type Result = Pin<Box<dyn Future<Output = Result<LockStatus, BackendError>>>>
The type of value that this handler will return. Read more
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