[][src]Trait ghost_actor::example::MyActorHandler

pub trait MyActorHandler<C: 'static + Send, I: 'static + Send>: 'static + Send {
    fn handle_test_message(
        &mut self,
        input: String
    ) -> MyActorHandlerResult<String>;
fn handle_add_one(&mut self, input: u32) -> MyActorHandlerResult<u32>;
fn handle_req_not_debug(
        &mut self,
        input: NotDebug
    ) -> MyActorHandlerResult<()>;
fn handle_funky_internal(
        &mut self,
        input: String
    ) -> MyActorHandlerResult<String>;
fn handle_funky_stop(&mut self) -> MyActorHandlerResult<()>; fn handle_ghost_actor_custom(&mut self, input: C) -> MyActorResult<()> { ... }
fn handle_ghost_actor_internal(&mut self, input: I) -> MyActorResult<()> { ... } }

Implement this trait to process incoming actor messages.

Required methods

fn handle_test_message(&mut self, input: String) -> MyActorHandlerResult<String>

A test message, sends a String, receives a String.

fn handle_add_one(&mut self, input: u32) -> MyActorHandlerResult<u32>

A test function, output adds 1 to input.

fn handle_req_not_debug(&mut self, input: NotDebug) -> MyActorHandlerResult<()>

Ensure we can take params that don't implement Deug

fn handle_funky_internal(
    &mut self,
    input: String
) -> MyActorHandlerResult<String>

Makes an internal_sender request from outside. In reality, you'd never need a command like this.

fn handle_funky_stop(&mut self) -> MyActorHandlerResult<()>

Calls internal ghost_actor_shutdown_immediate() command. In reality, you'd never need a command like this.

Loading content...

Provided methods

fn handle_ghost_actor_custom(&mut self, input: C) -> MyActorResult<()>

Handle custom messages specific to this exact actor implementation. The provided implementation panics with unimplemented!

fn handle_ghost_actor_internal(&mut self, input: I) -> MyActorResult<()>

Handle internal messages specific to this exact actor implementation. The provided implementation panics with unimplemented!

Loading content...

Implementors

Loading content...