[−][src]Module ghost_actor::example
Example usage for unit testing and showing documentation generation.
use ghost_actor::example::MyError; ghost_actor::ghost_chan! { Visibility(pub), Name(MyCustomChan), Error(MyError), Api { TestMsg("will respond with 'echo: input'", String, String,), } } ghost_actor::ghost_chan! { Visibility(pub), Name(MyInternalChan), Error(MyError), Api { TestMsg("will respond with 'echo: input'", String, String,), } } ghost_actor::ghost_actor! { Visibility(pub), Name(MyActor), Error(MyError), Api { TestMessage( "A test message, sends a String, receives a String.", String, String, ), AddOne( "A test function, output adds 1 to input.", u32, u32, ), FunkyInternal( "Makes an internal_sender request from outside. In reality, you'd never need a command like this.", String, String, ), FunkyStop( "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. |
NotDebug | This struct does not implement debug. |
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. |