pub struct FactoryEntry {
pub factory: Box<dyn Fn() -> Box<dyn MeshDaemon> + Send + Sync>,
pub keypair: Option<EntityKeypair>,
pub config: DaemonHostConfig,
pub expected_orchestrator: Option<u64>,
}Expand description
Bundle required to reconstruct a daemon on the target.
Fields§
§factory: Box<dyn Fn() -> Box<dyn MeshDaemon> + Send + Sync>Constructor for a fresh, unrestored daemon instance.
keypair: Option<EntityKeypair>The daemon’s signing keypair.
Some(kp)— caller pre-provisioned the keypair out-of-band. Used as the default at restore; the dispatcher’s envelope path can still override when the snapshot carries one.None— placeholder registration. The caller expects theIdentityEnvelopeto supply the keypair at restore time; if the snapshot arrives without an envelope, restore fails cleanly rather than silently synthesizing a wrong keypair.
config: DaemonHostConfigHost configuration to apply to the restored daemon.
expected_orchestrator: Option<u64>Optional orchestrator-node binding for the daemon. When
Some(node), the subprotocol handler rejects any
SnapshotReady for this origin whose from_node is not
node AND for which neither orchestrator-side nor target-
side state already records a principal. Without this
binding, the first SnapshotReady for a not-yet-known
daemon_origin TOFUs the sender as the orchestrator — any
session peer that beats the legitimate orchestrator becomes
the bound principal and can drive subsequent control
messages past the peer-auth gates. Operators that know the
orchestrator out-of-band (the common case) should set this
via DaemonFactoryRegistry::bind_expected_orchestrator
after register; None preserves the back-compat TOFU.