Skip to main content

AgentResolver

Trait AgentResolver 

Source
pub trait AgentResolver {
    // Required method
    fn resolve_agent(&self, agent_hash: &str) -> Option<&Agent>;
}
Expand description

Resolves an agent node’s declared hash to the Agent that executes it.

A small trait, not a fixed type, so a test can inject a map while the server injects its agent registry. A HashMap<String, Agent> implements it out of the box.

Required Methods§

Source

fn resolve_agent(&self, agent_hash: &str) -> Option<&Agent>

The agent registered under agent_hash, or None if none is.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl AgentResolver for HashMap<String, Agent>

Source§

fn resolve_agent(&self, agent_hash: &str) -> Option<&Agent>

Implementors§