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]

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]

Creates new RedisBackend builder with default settings.

Trait Implementations

impl Actor for RedisBackend[src]

Implementation actix Actor trait for Redis cache backend.

type Context = Context<RedisBackend>

Actor execution context type

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]

Called after an actor is in Actor::Stopping state. Read more

fn stopped(&mut self, ctx: &mut Self::Context)[src]

Called after an actor is stopped. Read more

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]

Construct and start a new asynchronous actor, returning its address. Read more

fn start_in_arbiter<F>(arb: &Arbiter, f: F) -> Addr<Self> where
    Self: Actor<Context = Context<Self>>,
    F: FnOnce(&mut Context<Self>) -> Self + Send + 'static, 
[src]

Start new actor in arbiter’s thread.

fn create<F>(f: F) -> Addr<Self> where
    Self: Actor<Context = Context<Self>>,
    F: FnOnce(&mut Context<Self>) -> Self, 
[src]

Start a new asynchronous actor given a Context. Read more

impl Backend for RedisBackend[src]

type Actor = RedisBackend

Type of backend actor bound.

type Context = Context<RedisBackend>

Type for backend Actor context.

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>>

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]

This method is called for every message received by this actor.

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>>

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]

This method is called for every message received by this actor.

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>>

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]

This method is called for every message received by this actor.

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>>

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]

This method is called for every message received by this actor.

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

impl<T> From<T> for T[src]

pub fn from(t: T) -> T[src]

Performs the conversion.

impl<T> Instrument for T[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]

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

pub fn into(self) -> U[src]

Performs the conversion.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]

Performs the conversion.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]

Performs the conversion.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>, 

pub fn vzip(self) -> V