pub trait Agent: Sync {
// Required method
fn ask(&self, request: &AgentRequest<'_>) -> Result<AgentAnswer, String>;
}Expand description
Who answers when an agent is asked. Steps that wait for none of each other ask at the same time, from more than one thread.
Required Methods§
Sourcefn ask(&self, request: &AgentRequest<'_>) -> Result<AgentAnswer, String>
fn ask(&self, request: &AgentRequest<'_>) -> Result<AgentAnswer, String>
Asks the agent.
§Errors
Why the agent could not answer: the work it was asked for is refused with it, and the rest of the run goes on.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".