pub struct PromptMessage {
pub role: &'static str,
pub content: McpContent,
}Expand description
A single message in a prompt response.
Fields§
§role: &'static str"user" or "assistant".
content: McpContentThe message content.
Implementations§
Source§impl PromptMessage
impl PromptMessage
Sourcepub fn user(text: impl Into<String>) -> PromptMessage
pub fn user(text: impl Into<String>) -> PromptMessage
Build a user-role message.
Sourcepub fn assistant(text: impl Into<String>) -> PromptMessage
pub fn assistant(text: impl Into<String>) -> PromptMessage
Build an assistant-role message.
Trait Implementations§
Source§impl Clone for PromptMessage
impl Clone for PromptMessage
Source§fn clone(&self) -> PromptMessage
fn clone(&self) -> PromptMessage
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 PromptMessage
impl RefUnwindSafe for PromptMessage
impl Send for PromptMessage
impl Sync for PromptMessage
impl Unpin for PromptMessage
impl UnsafeUnpin for PromptMessage
impl UnwindSafe for PromptMessage
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