pub struct GoogleStreamState { /* private fields */ }Expand description
Stream state: open text/reasoning blocks, streamed function calls, usage
and the metadata of the final finish part.
Implementations§
Source§impl GoogleStreamState
impl GoogleStreamState
Sourcepub fn new(mapper: OutputMapper) -> Self
pub fn new(mapper: OutputMapper) -> Self
Creates the state for one stream.
Trait Implementations§
Source§impl Debug for GoogleStreamState
impl Debug for GoogleStreamState
Source§impl StreamMachine for GoogleStreamState
impl StreamMachine for GoogleStreamState
Source§type Chunk = GenerateContentResponse
type Chunk = GenerateContentResponse
Provider chunk type.
Source§fn handle(
&mut self,
chunk: ParseResult<GenerateContentResponse>,
include_raw: bool,
) -> Vec<StreamPart>
fn handle( &mut self, chunk: ParseResult<GenerateContentResponse>, include_raw: bool, ) -> Vec<StreamPart>
Handles one chunk (or parse failure).
Source§fn finish(self) -> Vec<StreamPart>
fn finish(self) -> Vec<StreamPart>
Emits the closing parts once the chunk stream ended.
Auto Trait Implementations§
impl !RefUnwindSafe for GoogleStreamState
impl !UnwindSafe for GoogleStreamState
impl Freeze for GoogleStreamState
impl Send for GoogleStreamState
impl Sync for GoogleStreamState
impl Unpin for GoogleStreamState
impl UnsafeUnpin for GoogleStreamState
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