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