[−][src]Module ghost_actor::example
Example usage for unit testing and showing documentation generation.
use ghost_actor::example::MyError; ghost_actor::ghost_chan! { name: pub MyCustomChan, error: MyError, api: { TestMsg::test_msg("will respond with 'echo: input'", String, String), } } ghost_actor::ghost_chan! { name: pub MyInternalChan, error: MyError, api: { TestMsg::test_msg("will respond with 'echo: input'", String, String), } } ghost_actor::ghost_actor! { name: pub MyActor, error: MyError, api: { TestMessage::test_message( "A test message, sends a String, receives a String.", String, String), AddOne::add_one( "A test function, output adds 1 to input.", u32, u32), FunkyInternal::funky_internal( "Makes an internal_sender request from outside. In reality, you'd never need a command like this.", String, must_future::MustBoxFuture<'static, String>), FunkyStop::funky_stop( "Calls internal ghost_actor_shutdown_immediate() command. In reality, you'd never need a command like this.", (), ()), } }
Structs
MyActorHelper | Helper for ghost_actor Sender custom. |
MyActorInternalSender | The InternalSender accessible from within handlers. |
MyActorSender | A cheaply clone-able handle to control a ghost_actor task. |
Enums
MyCustomChan | GhostChan protocol enum. |
MyError | Custom example error type. |
MyInternalChan | GhostChan protocol enum. |
Traits
MyActorHandler | Implement this trait to process incoming actor messages. |
MyCustomChanSend | GhostChan protocol enum send trait. |
MyInternalChanSend | GhostChan protocol enum send trait. |
Type Definitions
MyActorFuture | Future Type. |
MyActorHandlerResult | Handler Result Type. |
MyActorResult | Result Type. |