Expand description
Getting events from somewhere.
Everything else in this crate is synchronous. This is the one layer that
talks to the outside world, and the only place async appears — which is
what lets the rest of the crate run under any executor, or none.
Transport is deliberately small: hand it a RunAgentInput, get back a
stream of Events. Implementations shipped here:
sse— thetext/event-streamdecoder every HTTP transport needs.http(featurehttp) —HttpTransport, backed byreqwest.replay—ReplayTransport, which serves a scripted list of events and records what was sent to it. Tests use it; so does the doc example.
A wasm frontend, an in-process agent, a websocket, a recorded fixture: each
is an impl Transport, and nothing above this module changes.
Re-exports§
pub use replay::ReplayTransport;pub use sse::SseDecoder;pub use sse::SseFrame;pub use sse::decode_events;pub use http::HttpTransport;pub use http::HttpTransportBuilder;
Modules§
- http
- The
reqwest-backed HTTP transport. - replay
- A transport that replays a scripted list of events.
- sse
- Decoding
text/event-stream.
Traits§
- Transport
- Somewhere an agent’s events come from.
Functions§
- boxed_
stream - Boxes a stream into the shape
Transport::runreturns.
Type Aliases§
- Event
Stream - A boxed stream of events, as a transport hands it over.
- Transport
Future - The future
Transport::runreturns: connecting, before any event arrives.