pub enum Backend {
Local(SessionHandle),
Remote(Client),
}Expand description
A handle to a session, local or remote.
Variants§
Implementations§
Source§impl Backend
impl Backend
Sourcepub fn send_from(&self, from: SessionId, request: Request) -> Result<(), Closed>
pub fn send_from(&self, from: SessionId, request: Request) -> Result<(), Closed>
Fire-and-forget, attributed to from (A2A): the sender reaches the
target’s before_inbound and sender tag, local or over a socket.
Sourcepub async fn ask_within(
&self,
request: Request,
dur: Duration,
) -> Result<AgentEvent, AskError>
pub async fn ask_within( &self, request: Request, dur: Duration, ) -> Result<AgentEvent, AskError>
Like Backend::ask, but bounded (item-41 residual). The single
choke point for every bounded ask: a hung in-process
SessionHandle::ask and a hung-but-open Client::ask both time out to
AskError::Timeout. Submit stays unbounded (a long turn is not a
hang); callers pass dur only for short command/side queries.
Sourcepub async fn ask(&self, request: Request) -> Result<AgentEvent, Closed>
pub async fn ask(&self, request: Request) -> Result<AgentEvent, Closed>
Send and await the correlated reply.
Sourcepub fn subscribe(&self) -> Receiver<AgentEvent>
pub fn subscribe(&self) -> Receiver<AgentEvent>
Stream the session’s events.
Trait Implementations§
Source§impl From<SessionHandle> for Backend
impl From<SessionHandle> for Backend
Source§fn from(handle: SessionHandle) -> Self
fn from(handle: SessionHandle) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl !RefUnwindSafe for Backend
impl !UnwindSafe for Backend
impl Freeze for Backend
impl Send for Backend
impl Sync for Backend
impl Unpin for Backend
impl UnsafeUnpin for Backend
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