pub struct HistoryMessage {
pub role: String,
pub content: String,
pub data: Option<Value>,
}Expand description
One entry of conversation history, oldest first in a slice.
Deliberately minimal: this crate does not depend on any particular chat message type, so callers map their own history onto this.
Fields§
§role: StringWho produced the message. Only used for reporting.
content: StringThe textual content, which may embed an envelope or <a2ui-json> blocks.
data: Option<Value>Structured payload, when the transport carried one (a tool result, an
A2A data part). Checked before content.
Implementations§
Trait Implementations§
Source§impl Clone for HistoryMessage
impl Clone for HistoryMessage
Source§fn clone(&self) -> HistoryMessage
fn clone(&self) -> HistoryMessage
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 moreSource§impl Debug for HistoryMessage
impl Debug for HistoryMessage
Source§impl Default for HistoryMessage
impl Default for HistoryMessage
Source§fn default() -> HistoryMessage
fn default() -> HistoryMessage
Returns the “default value” for a type. Read more
Source§impl From<&Message> for HistoryMessage
Maps an AG-UI message onto the toolkit’s transport-neutral history entry.
impl From<&Message> for HistoryMessage
Maps an AG-UI message onto the toolkit’s transport-neutral history entry.
Text goes to content and structured payloads to data, which is the split
crate::toolkit::history scans on. A user’s multimodal parts are flattened
to their text: an A2UI envelope is never an image.
Source§impl PartialEq for HistoryMessage
impl PartialEq for HistoryMessage
Source§fn eq(&self, other: &HistoryMessage) -> bool
fn eq(&self, other: &HistoryMessage) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for HistoryMessage
Auto Trait Implementations§
impl Freeze for HistoryMessage
impl RefUnwindSafe for HistoryMessage
impl Send for HistoryMessage
impl Sync for HistoryMessage
impl Unpin for HistoryMessage
impl UnsafeUnpin for HistoryMessage
impl UnwindSafe for HistoryMessage
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