Crate actix_handler_macro

Source
Expand description

§actix_handler_macro

Helper macros for using Actix.

use actix::Message;
use actix_handler_macro::{actix_handler, Actor};

#[derive(Actor)]
struct Example;
type ExampleContext = actix::Context<Example>;

#[derive(Message)]
#[rtype(result = "String")]
struct Greeting {
    name: String,
}

#[actix_handler]
impl Example {
    fn greet(&self, message: Greeting, _ctx: &ExampleContext) -> String {
        format!("Hello {}", message.name).to_string()
    }
}

Attribute Macros§

actix_handler
Allows writing Actix actors with impl blocks.

Derive Macros§

Actor
ArbiterService
Supervised