pub struct StreamToken {
pub content: String,
pub token_type: TokenType,
pub position: usize,
pub is_final: bool,
pub metadata: Option<Value>,
}Expand description
Streaming response token
Fields§
§content: StringToken content
token_type: TokenTypeToken type (text, tool_call, metadata, etc.)
position: usizePosition in the stream
is_final: boolWhether this is the final token
metadata: Option<Value>Token metadata
Implementations§
Trait Implementations§
Source§impl Clone for StreamToken
impl Clone for StreamToken
Source§fn clone(&self) -> StreamToken
fn clone(&self) -> StreamToken
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 moreSource§impl Debug for StreamToken
impl Debug for StreamToken
Source§impl<'de> Deserialize<'de> for StreamToken
impl<'de> Deserialize<'de> for StreamToken
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for StreamToken
impl RefUnwindSafe for StreamToken
impl Send for StreamToken
impl Sync for StreamToken
impl Unpin for StreamToken
impl UnwindSafe for StreamToken
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