use std::sync::Arc;
use serde::{Deserialize, Serialize};
use super::address::Address;
use super::path::ActorPath;
#[derive(Clone, Debug)]
pub struct SerializedMessage {
pub serializer_id: u32,
pub manifest: String,
pub payload: Vec<u8>,
pub sender: Option<ActorPath>,
}
#[derive(Clone, Debug, Serialize, Deserialize)]
pub enum RemoteSystemMsg {
Stop,
Watch { watcher: ActorPath },
Unwatch { watcher: ActorPath },
Terminated { actor: ActorPath },
}
pub trait RemoteRef: Send + Sync + std::fmt::Debug {
fn path(&self) -> &ActorPath;
fn tell_serialized(&self, msg: SerializedMessage);
fn tell_system(&self, msg: RemoteSystemMsg);
}
pub trait RemoteProvider: Send + Sync {
fn local_address(&self) -> &Address;
fn resolve(&self, path: &ActorPath) -> Option<Arc<dyn RemoteRef>>;
}