pub struct EventStream { /* private fields */ }Expand description
The receiving end of a provider stream.
Implementations§
Source§impl EventStream
impl EventStream
Sourcepub fn channel() -> (EventSender, EventStream)
pub fn channel() -> (EventSender, EventStream)
A stream fed by sender.
Sourcepub async fn next(&mut self) -> Option<StreamEvent>
pub async fn next(&mut self) -> Option<StreamEvent>
The next event, or None after the final one.
Sourcepub async fn result(self) -> Option<AssistantMessage>
pub async fn result(self) -> Option<AssistantMessage>
Drains the stream and returns the final message.
Trait Implementations§
Auto Trait Implementations§
impl Forget for EventStream
impl Freeze for EventStream
impl RefUnwindSafe for EventStream
impl Send for EventStream
impl Sync for EventStream
impl Unpin for EventStream
impl UnsafeUnpin for EventStream
impl UnwindSafe for EventStream
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