pub struct Agent { /* private fields */ }Expand description
Agent is low-level abstraction over transaction list that handles concurrency and time outs (via Collect call).
Implementations§
Source§impl Agent
impl Agent
Sourcepub fn handle_event(&mut self, client_agent: ClientAgent) -> Result<()>
pub fn handle_event(&mut self, client_agent: ClientAgent) -> Result<()>
Applies an agent command: start, stop, process a message, collect timeouts, or close.
§Errors
Fails if the agent is closed, or a transaction id is already in use.
Sourcepub fn poll_timeout(&mut self) -> Option<Instant>
pub fn poll_timeout(&mut self) -> Option<Instant>
When the agent next needs ClientAgent::Collect, or None with nothing outstanding.
Sourcepub fn poll_event(&mut self) -> Option<Event>
pub fn poll_event(&mut self) -> Option<Event>
The next transaction event, or None when there is nothing to report.
Trait Implementations§
Auto Trait Implementations§
impl Forget for Agent
impl Freeze for Agentwhere
*const u8 is !null: Freeze,
PhantomData<(TransactionId, AgentTransaction)>: Freeze,
PhantomData<Event>: Freeze,
impl Move for Agent
impl RefUnwindSafe for Agent
impl Send for Agent
impl Sync for Agent
impl Unpin for Agent
impl UnsafeUnpin for Agentwhere
*const u8 is !null: UnsafeUnpin,
PhantomData<(TransactionId, AgentTransaction)>: UnsafeUnpin,
PhantomData<Event>: UnsafeUnpin,
impl UnwindSafe for Agent
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