pub struct StreamParser {
pub model: Option<String>,
pub request_id: Option<String>,
/* private fields */
}Expand description
Accumulates streaming data and produces StreamEvent values.
Maintains partial state for each content block index as deltas arrive,
then emits a ContentBlockComplete when the block is finalized.
Fields§
§model: Option<String>Model that generated this response.
request_id: Option<String>API request ID.
Implementations§
Source§impl StreamParser
impl StreamParser
pub fn new() -> Self
Sourcepub fn process(&mut self, raw: RawSseEvent) -> Vec<StreamEvent>
pub fn process(&mut self, raw: RawSseEvent) -> Vec<StreamEvent>
Process a raw SSE event and return any resulting stream events.
Auto Trait Implementations§
impl Freeze for StreamParser
impl RefUnwindSafe for StreamParser
impl Send for StreamParser
impl Sync for StreamParser
impl Unpin for StreamParser
impl UnsafeUnpin for StreamParser
impl UnwindSafe for StreamParser
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