agner_actors/
lib.rs

1//! Core Support for Actors
2//! =====
3
4mod actor;
5mod actor_id;
6mod actor_runner;
7mod context;
8mod exit;
9mod exit_handler;
10mod spawn_opts;
11mod system;
12mod system_config;
13
14mod exports {
15    pub use crate::actor::Actor;
16    pub use crate::actor_id::ActorID;
17    pub use crate::context::{Context, Event, Signal};
18    pub use crate::exit::{Exit, Shutdown};
19    pub use crate::exit_handler::ExitHandler;
20    pub use crate::spawn_opts::SpawnOpts;
21    pub use crate::system::{ActorChannel, System, SystemWeakRef};
22    pub use crate::system_config::SystemConfig;
23
24    pub use crate::actor_runner::ActorInfo;
25
26    pub mod system_error {
27        pub use crate::system::{SysChannelError, SysSpawnError};
28    }
29
30    pub mod exit_reason {
31        pub use crate::exit::{BackendFailure, WellKnown};
32    }
33
34    /// Standard [exit-handlers](crate::exit_handler::ExitHandler)
35    pub mod exit_handlers {
36        pub use crate::exit_handler::{LogExitHandler, NoopExitHandler};
37    }
38}
39mod imports {
40    use std::sync::Arc;
41
42    /// A type that cannot be instantiated.
43    pub type Never = futures::never::Never;
44
45    /// Boxed [standard error](std::error::Error)
46    pub type BoxError = Box<dyn std::error::Error + Send + Sync + 'static>;
47
48    /// Arc-ed [standard error](std::error::Error)
49    pub type ArcError = Arc<dyn std::error::Error + Send + Sync + 'static>;
50}
51
52pub use exports::*;
53pub use imports::*;