pub struct RemoteAgent<T> { /* private fields */ }Expand description
A checked typed event interface over any Transport. HTTP, an in-process
agent or a recorded fixture can supply events without state management.
§Not crate::server::Agent
The client and server APIs sit on opposite ends of the same wire, and the word “agent”
means the opposite thing at each end, so they do not share a name.
crate::server::Agent is a trait you implement to be an agent;
RemoteAgent is a handle you hold onto someone else’s. An agent that calls
another agent — the composition case — needs both in one file, and
impl Agent for X { … self.upstream: RemoteAgent<_> … } reads correctly
only because they are spelled differently.
Implementations§
Source§impl<T> RemoteAgent<T>
impl<T> RemoteAgent<T>
Source§impl<T: Transport> RemoteAgent<T>
impl<T: Transport> RemoteAgent<T>
Sourcepub fn run_events(&self, params: impl Into<RunAgentInput>) -> EventStream
pub fn run_events(&self, params: impl Into<RunAgentInput>) -> EventStream
Starts a run and streams events after compatibility and enforcement.
Chunks remain chunks; ordering is not verified or assembled here. A UI
wants Thread, while a proxy needing original
fields calls Transport::run and takes
TransportStream::into_json.
Connecting is folded into the stream: a transport that cannot reach the agent yields one error item and ends.
The boundary’s warnings are discarded here. A Thread reports them;
TransportStream::into_events over Transport::run hands them to
a callback.
The request omits activity messages, which belong to the local rendering
history, and upgrades legacy binary content to its 1.0 media part.