pub struct Message {
pub message_id: String,
pub context_id: Option<String>,
pub task_id: Option<String>,
pub from_user: bool,
pub parts: Vec<Part>,
pub metadata: Option<Value>,
pub extensions: Vec<String>,
}Expand description
An A2A message.
Fields§
§message_id: StringUnique per message (the idempotency key).
context_id: Option<String>The conversation.
task_id: Option<String>Continues this task (an answer to input-required).
from_user: boolFrom the caller (user) rather than the agent.
parts: Vec<Part>Content.
metadata: Option<Value>Extension data.
extensions: Vec<String>Extensions this message uses.
Implementations§
Source§impl Message
impl Message
Sourcepub fn user(message_id: &str, context_id: &str, parts: Vec<Part>) -> Self
pub fn user(message_id: &str, context_id: &str, parts: Vec<Part>) -> Self
A message from the caller.
Sourcepub fn with_context(self, context: &DelegationContext) -> Self
pub fn with_context(self, context: &DelegationContext) -> Self
Attaches the delegation context.
Sourcepub fn context(&self) -> Option<DelegationContext>
pub fn context(&self) -> Option<DelegationContext>
The delegation context, when present and valid.
Trait Implementations§
impl StructuralPartialEq for Message
Auto Trait Implementations§
impl Freeze for Message
impl RefUnwindSafe for Message
impl Send for Message
impl Sync for Message
impl Unpin for Message
impl UnsafeUnpin 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