pub struct TextMessageChunkEvent {
pub base: BaseEvent,
pub message_id: Option<MessageId>,
pub role: Role,
pub delta: Option<String>,
}Expand description
Event containing a chunk of text message content.
This event combines start, content, and potentially end information in a single event. Used as a non-streaming alternative where all fields may be optional.
Fields§
§base: BaseEventCommon event fields (timestamp, rawEvent).
message_id: Option<MessageId>Optional message ID (may be omitted for continuation chunks).
role: RoleThe role of the message sender.
delta: Option<String>Optional text content delta.
Implementations§
Source§impl TextMessageChunkEvent
impl TextMessageChunkEvent
Sourcepub fn with_message_id(self, message_id: impl Into<MessageId>) -> Self
pub fn with_message_id(self, message_id: impl Into<MessageId>) -> Self
Sets the message ID for this event.
Sourcepub fn with_delta(self, delta: impl Into<String>) -> Self
pub fn with_delta(self, delta: impl Into<String>) -> Self
Sets the delta for this event.
Sourcepub fn with_timestamp(self, timestamp: f64) -> Self
pub fn with_timestamp(self, timestamp: f64) -> Self
Sets the timestamp for this event.
Trait Implementations§
Source§impl Clone for TextMessageChunkEvent
impl Clone for TextMessageChunkEvent
Source§fn clone(&self) -> TextMessageChunkEvent
fn clone(&self) -> TextMessageChunkEvent
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 TextMessageChunkEvent
impl Debug for TextMessageChunkEvent
Source§impl<'de> Deserialize<'de> for TextMessageChunkEvent
impl<'de> Deserialize<'de> for TextMessageChunkEvent
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
Source§impl PartialEq for TextMessageChunkEvent
impl PartialEq for TextMessageChunkEvent
Source§impl Serialize for TextMessageChunkEvent
impl Serialize for TextMessageChunkEvent
impl StructuralPartialEq for TextMessageChunkEvent
Auto Trait Implementations§
impl Freeze for TextMessageChunkEvent
impl RefUnwindSafe for TextMessageChunkEvent
impl Send for TextMessageChunkEvent
impl Sync for TextMessageChunkEvent
impl Unpin for TextMessageChunkEvent
impl UnsafeUnpin for TextMessageChunkEvent
impl UnwindSafe for TextMessageChunkEvent
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