pub struct StreamAggregator { /* private fields */ }Expand description
Accumulates a streaming response into a final Message plus
aggregated metadata. Chunk ordering matters for text content and for
tool-call argument deltas — feed chunks in the order they arrive.
Implementations§
Source§impl StreamAggregator
impl StreamAggregator
Sourcepub fn push(&mut self, chunk: StreamChunk)
pub fn push(&mut self, chunk: StreamChunk)
Feed a single chunk. Cheap; safe to call inline as chunks arrive.
Sourcepub fn finalize(self) -> Aggregated
pub fn finalize(self) -> Aggregated
Drain the aggregator into a finalized assistant message + metadata.
Trait Implementations§
Source§impl Clone for StreamAggregator
impl Clone for StreamAggregator
Source§fn clone(&self) -> StreamAggregator
fn clone(&self) -> StreamAggregator
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for StreamAggregator
impl Debug for StreamAggregator
Source§impl Default for StreamAggregator
impl Default for StreamAggregator
Source§fn default() -> StreamAggregator
fn default() -> StreamAggregator
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for StreamAggregator
impl RefUnwindSafe for StreamAggregator
impl Send for StreamAggregator
impl Sync for StreamAggregator
impl Unpin for StreamAggregator
impl UnsafeUnpin for StreamAggregator
impl UnwindSafe for StreamAggregator
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