pub struct StreamAccumulator { /* private fields */ }Expand description
Accumulates streaming events into content blocks.
Implementations§
Source§impl StreamAccumulator
impl StreamAccumulator
pub fn new() -> Self
pub fn process_event(&mut self, event: StreamEvent)
pub fn into_response(self) -> Result<CompletionResponse>
Sourcepub fn current_text(&self) -> String
pub fn current_text(&self) -> String
Get accumulated text so far (for streaming display).
Trait Implementations§
Auto Trait Implementations§
impl Freeze for StreamAccumulator
impl RefUnwindSafe for StreamAccumulator
impl Send for StreamAccumulator
impl Sync for StreamAccumulator
impl Unpin for StreamAccumulator
impl UnsafeUnpin for StreamAccumulator
impl UnwindSafe for StreamAccumulator
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