pub mod codemgr;
pub mod factory;
pub mod loader;
pub mod migration;
pub mod types;
#[cfg(feature = "hot_code_loading")]
pub mod dynamic_supervisor;
pub use codemgr::{CodeManager, CodePath};
pub use factory::ActorFactory;
pub use loader::{DynamicLibrary, LibraryLoader};
pub use migration::{MigrationFn, MigrationRegistry, StateMigration};
pub use types::{
ActorSpec, ActorVTable, DeserializeFn, DropFn, MessageHandler, MigrateFn, SerializeFn,
VersionedActorRef, WorkItem, WorkerError, WorkerMessage, WorkerResponder,
};
#[cfg(feature = "hot_code_loading")]
pub use dynamic_supervisor::DynamicSupervisor;
use crate::error::RuntimeError;
pub trait HotSwappable: crate::actor::Actor {
const VERSION: &'static str;
fn serialize(&self) -> Vec<u8>;
fn deserialize(state: &[u8]) -> Result<Self, RuntimeError>
where
Self: Sized;
fn state_matches(&self, other: &Self) -> bool;
}
#[must_use]
#[derive(Debug, Clone, PartialEq, Eq)]
pub enum CodeChangeResult {
Upgraded {
module: String,
new_version: String,
old_version: String,
},
Failed {
reason: RuntimeError,
},
}
#[cfg(test)]
mod tests;