pub struct AgentSandbox { /* private fields */ }Expand description
An agent sandbox provides isolated execution with deontic interrupt capability. Each agent gets its own phase leaser.
Implementations§
Source§impl AgentSandbox
impl AgentSandbox
Sourcepub fn register_agent(
&mut self,
agent_id: u32,
leaser: PhaseLeaser,
) -> Result<(), LeaseError>
pub fn register_agent( &mut self, agent_id: u32, leaser: PhaseLeaser, ) -> Result<(), LeaseError>
Register an agent with its phase leaser.
Sourcepub fn verify_capability(
&mut self,
agent_id: u32,
cap: &str,
node_id: Option<u32>,
) -> Result<(), LeaseError>
pub fn verify_capability( &mut self, agent_id: u32, cap: &str, node_id: Option<u32>, ) -> Result<(), LeaseError>
Verify a capability for a specific agent.
Sourcepub fn global_halt(&mut self, description: &str)
pub fn global_halt(&mut self, description: &str)
Trigger a global interrupt — halts all agents.
Sourcepub fn get_leaser(&self, agent_id: u32) -> Option<&PhaseLeaser>
pub fn get_leaser(&self, agent_id: u32) -> Option<&PhaseLeaser>
Get the leaser for a specific agent.
Sourcepub fn agent_count(&self) -> usize
pub fn agent_count(&self) -> usize
Get the number of registered agents.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for AgentSandbox
impl RefUnwindSafe for AgentSandbox
impl Send for AgentSandbox
impl Sync for AgentSandbox
impl Unpin for AgentSandbox
impl UnsafeUnpin for AgentSandbox
impl UnwindSafe for AgentSandbox
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more