pub enum Message {
User(UserMessage),
Assistant(AssistantMessage),
}Expand description
A message in the conversation
Variants§
Implementations§
Source§impl Message
impl Message
Sourcepub fn session_id(&self) -> &str
pub fn session_id(&self) -> &str
Returns the session ID
Sourcepub fn role(&self) -> MessageRole
pub fn role(&self) -> MessageRole
Returns the role of this message
Sourcepub fn created_at(&self) -> i64
pub fn created_at(&self) -> i64
Returns the creation timestamp
Sourcepub fn content(&self) -> &[ContentBlock]
pub fn content(&self) -> &[ContentBlock]
Returns the content blocks
Sourcepub fn content_mut(&mut self) -> &mut Vec<ContentBlock>
pub fn content_mut(&mut self) -> &mut Vec<ContentBlock>
Returns mutable content blocks for modification (e.g., compaction)
Sourcepub fn is_assistant(&self) -> bool
pub fn is_assistant(&self) -> bool
Returns true if this is an assistant message
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Message
impl RefUnwindSafe for Message
impl Send for Message
impl Sync for Message
impl Unpin for Message
impl UnwindSafe for Message
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more