pub struct AgentHandle<T> { /* private fields */ }Expand description
Handle to a spawned agent.
This is returned by spawn() and can be awaited to get the agent’s result.
Implementations§
Source§impl<T> AgentHandle<T>
impl<T> AgentHandle<T>
Sourcepub async fn result(self) -> SageResult<T>
pub async fn result(self) -> SageResult<T>
Wait for the agent to complete and return its result.
Sourcepub async fn send(&self, msg: Message) -> SageResult<()>
pub async fn send(&self, msg: Message) -> SageResult<()>
Send a message to the agent.
Auto Trait Implementations§
impl<T> Freeze for AgentHandle<T>
impl<T> RefUnwindSafe for AgentHandle<T>
impl<T> Send for AgentHandle<T>where
T: Send,
impl<T> Sync for AgentHandle<T>where
T: Send,
impl<T> Unpin for AgentHandle<T>
impl<T> UnsafeUnpin for AgentHandle<T>
impl<T> UnwindSafe for AgentHandle<T>
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