1mod agent;
23mod builder;
24mod identity;
25mod supervisor;
26
27pub mod constants;
28pub mod core;
29pub mod http;
30
31pub use agent::Agent;
32pub use builder::AgentBuilder;
33pub use identity::{AgentIdentity, get_global_identity, init_global_identity};
34
35pub type Result<T> = std::result::Result<T, Error>;
37
38#[derive(Debug, thiserror::Error)]
40pub enum Error {
41 #[error("IO error: {0}")]
42 Io(#[from] std::io::Error),
43
44 #[error("Actor error: {0}")]
45 Actor(String),
46
47 #[error("Configuration error: {0}")]
48 Config(String),
49
50 #[error("Supervisor error: {0}")]
51 Supervisor(String),
52}
53
54impl From<ractor::SpawnErr> for Error {
56 fn from(e: ractor::SpawnErr) -> Self {
57 Error::Actor(e.to_string())
58 }
59}