pub trait IntoCache: Cacheable {
    // Provided method
    fn into_cache<A>(self, upstream: &Addr<A>) -> QueryCache<A, Self>
       where A: Actor,
             Self: Message + Send + Sized,
             Self::Result: MessageResponse<A, Self> + Send + 'static { ... }
}Expand description
Trait describes coversion from any actix::Message into QueryCache message.
Provided Methods§
Sourcefn into_cache<A>(self, upstream: &Addr<A>) -> QueryCache<A, Self>
 
fn into_cache<A>(self, upstream: &Addr<A>) -> QueryCache<A, Self>
Helper method to convert Message into QueryCache message.
§Examples
use actix::prelude::*;
use hitbox_actix::prelude::*;
use serde::Serialize;
struct Upstream;
impl Actor for Upstream {
    type Context = Context<Self>;
}
#[derive(Cacheable, Serialize, Message, Debug, PartialEq)]
#[rtype(result = "()")]
struct QueryNothing {
    id: Option<i32>,
}
#[actix_rt::main]
async fn main() {
    let upstream = Upstream.start();
    let query = QueryNothing { id: Some(1) }
        .into_cache(&upstream);
}