pub struct TurnStreamCollector { /* private fields */ }Expand description
Shared turn stream collector engine used by runtime prompt and artifact execution flows.
It filters by (thread_id, turn_id), accumulates assistant text, and reports terminal events.
Implementations§
Source§impl TurnStreamCollector
impl TurnStreamCollector
Sourcepub fn push_envelope(
&mut self,
envelope: &Envelope,
) -> Option<TurnTerminalEvent>
pub fn push_envelope( &mut self, envelope: &Envelope, ) -> Option<TurnTerminalEvent>
Consume one envelope. Returns terminal event when this envelope closes the target turn.
Sourcepub fn is_target_envelope(&self, envelope: &Envelope) -> bool
pub fn is_target_envelope(&self, envelope: &Envelope) -> bool
Whether one envelope belongs to this collector turn target.
Sourcepub fn matching_turn_events(&self) -> usize
pub fn matching_turn_events(&self) -> usize
Number of consumed envelopes that matched the target turn.
Sourcepub fn assistant_text(&self) -> &str
pub fn assistant_text(&self) -> &str
Borrow current collected assistant text.
Sourcepub fn into_assistant_text(self) -> String
pub fn into_assistant_text(self) -> String
Take ownership of collected assistant text.
Trait Implementations§
Source§impl Clone for TurnStreamCollector
impl Clone for TurnStreamCollector
Source§fn clone(&self) -> TurnStreamCollector
fn clone(&self) -> TurnStreamCollector
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for TurnStreamCollector
impl RefUnwindSafe for TurnStreamCollector
impl Send for TurnStreamCollector
impl Sync for TurnStreamCollector
impl Unpin for TurnStreamCollector
impl UnsafeUnpin for TurnStreamCollector
impl UnwindSafe for TurnStreamCollector
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