pub struct SseClient { /* private fields */ }Expand description
SSE client for consuming AG-UI event streams.
The client connects to an SSE endpoint and provides a stream of parsed AG-UI events.
Implementations§
Source§impl SseClient
impl SseClient
Sourcepub async fn connect_with_config(url: &str, config: SseConfig) -> Result<Self>
pub async fn connect_with_config(url: &str, config: SseConfig) -> Result<Self>
Connects to an SSE endpoint with custom configuration.
§Arguments
url- The SSE endpoint URLconfig- Connection configuration
§Example
ⓘ
let config = SseConfig::new()
.connect_timeout(Duration::from_secs(60))
.bearer_token("my-token");
let client = SseClient::connect_with_config("http://localhost:3000/events", config).await?;Sourcepub fn into_stream(self) -> SseEventStream
pub fn into_stream(self) -> SseEventStream
Converts this client into an event stream.
The stream yields parsed AG-UI events as they arrive.
Auto Trait Implementations§
impl !Freeze for SseClient
impl !RefUnwindSafe for SseClient
impl Send for SseClient
impl !Sync for SseClient
impl Unpin for SseClient
impl UnsafeUnpin for SseClient
impl !UnwindSafe for SseClient
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