pub struct DisplayMessage {
pub role: MessageRole,
pub content: String,
}Expand description
A single message displayed in the chat pane.
Fields§
§role: MessageRole§content: StringImplementations§
Source§impl DisplayMessage
impl DisplayMessage
pub fn new(role: MessageRole, content: impl Into<String>) -> Self
pub fn user(content: impl Into<String>) -> Self
pub fn assistant(content: impl Into<String>) -> Self
pub fn info(content: impl Into<String>) -> Self
pub fn success(content: impl Into<String>) -> Self
pub fn warning(content: impl Into<String>) -> Self
pub fn error(content: impl Into<String>) -> Self
pub fn system(content: impl Into<String>) -> Self
pub fn tool_call(content: impl Into<String>) -> Self
pub fn tool_result(content: impl Into<String>) -> Self
pub fn thinking(content: impl Into<String>) -> Self
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