pub struct AgentSession<A: Agent + ?Sized> {
pub controller: Controller,
pub next_state: Option<Next<A>>,
pub joint: AddressJoint<A>,
pub address: Address<A>,
}Fields§
§controller: Controller§next_state: Option<Next<A>>§joint: AddressJoint<A>§address: Address<A>Implementations§
Source§impl<A: Agent> AgentSession<A>
impl<A: Agent> AgentSession<A>
Methods from Deref<Target = Address<A>>§
pub fn send(&self, msg: impl MessageFor<A>) -> Result<()>
Sourcepub async fn join(&mut self) -> Result<AgentStatus>
pub async fn join(&mut self) -> Result<AgentStatus>
Important! join must use a reference to allow using it under DerefMut trait
pub fn sender<M>(&self) -> Recipient<M>where
M: MessageFor<A>,
pub fn event<E>(&self, event: E) -> Result<()>
pub fn recipient<E>(&self) -> Recipient<E>
pub fn interrupt(&self) -> Result<()>
Trait Implementations§
Source§impl<A: Agent> AgentContext<A> for AgentSession<A>
impl<A: Agent> AgentContext<A> for AgentSession<A>
fn session(&mut self) -> &mut AgentSession<A>
Source§impl<A: Agent> Default for AgentSession<A>
impl<A: Agent> Default for AgentSession<A>
Source§impl<A: Agent> ManagedContext for AgentSession<A>
impl<A: Agent> ManagedContext for AgentSession<A>
Auto Trait Implementations§
impl<A> Freeze for AgentSession<A>
impl<A> !RefUnwindSafe for AgentSession<A>
impl<A> Send for AgentSession<A>
impl<A> !Sync for AgentSession<A>
impl<A> Unpin for AgentSession<A>
impl<A> !UnwindSafe for AgentSession<A>
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