pub struct AssistantMessageEventStreamProducer { /* private fields */ }Expand description
The producer side. Mirrors the TS pusher: push(ev) until a terminal event,
at which point the result oneshot is fulfilled (first terminal wins; push
after a terminal event is a no-op matching if (this.done) return).
Implementations§
Source§impl AssistantMessageEventStreamProducer
impl AssistantMessageEventStreamProducer
Sourcepub fn push(&mut self, event: AssistantMessageEvent) -> bool
pub fn push(&mut self, event: AssistantMessageEvent) -> bool
Push an event. Returns false if the consumer has dropped the stream
(back-pressure / cancellation). After a terminal Done/Error is
pushed, further push calls are no-ops returning true (the stream is
“done” but alive), mirroring TS push semantics. The terminal event
itself is always delivered (so the consumer sees it) before the flag
takes effect.
pub fn is_done(&self) -> bool
Auto Trait Implementations§
impl !RefUnwindSafe for AssistantMessageEventStreamProducer
impl !UnwindSafe for AssistantMessageEventStreamProducer
impl Freeze for AssistantMessageEventStreamProducer
impl Send for AssistantMessageEventStreamProducer
impl Sync for AssistantMessageEventStreamProducer
impl Unpin for AssistantMessageEventStreamProducer
impl UnsafeUnpin for AssistantMessageEventStreamProducer
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