pub struct DisplayMessage {
pub role: DisplayRole,
pub content: String,
pub tool_call: Option<DisplayToolCall>,
pub collapsed: bool,
pub thinking_started_at: Option<Instant>,
pub thinking_duration_secs: Option<u64>,
}Expand description
A message prepared for display in the conversation widget.
Fields§
§role: DisplayRole§content: String§tool_call: Option<DisplayToolCall>Optional tool call info for assistant messages.
collapsed: boolWhether this message is collapsed.
thinking_started_at: Option<Instant>When reasoning started (for computing finalized duration).
thinking_duration_secs: Option<u64>Finalized thinking duration in seconds (set when thinking ends).
Implementations§
Source§impl DisplayMessage
impl DisplayMessage
Sourcepub fn new(role: DisplayRole, content: impl Into<String>) -> Self
pub fn new(role: DisplayRole, content: impl Into<String>) -> Self
Convenience constructor for the common case (no tool call, not collapsed).
Trait Implementations§
Source§impl Clone for DisplayMessage
impl Clone for DisplayMessage
Source§fn clone(&self) -> DisplayMessage
fn clone(&self) -> DisplayMessage
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 moreAuto Trait Implementations§
impl Freeze for DisplayMessage
impl RefUnwindSafe for DisplayMessage
impl Send for DisplayMessage
impl Sync for DisplayMessage
impl Unpin for DisplayMessage
impl UnsafeUnpin for DisplayMessage
impl UnwindSafe for DisplayMessage
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