pub struct Message {
pub message_id: String,
pub context_id: Option<String>,
pub task_id: Option<String>,
pub role: Role,
pub parts: Vec<Part>,
pub metadata: Option<JsonObject>,
pub extensions: Vec<String>,
pub reference_task_ids: Vec<String>,
}Expand description
Protocol message exchanged between user and agent.
Fields§
§message_id: StringUnique message identifier.
context_id: Option<String>Optional conversation context identifier.
task_id: Option<String>Optional task identifier associated with the message.
role: RoleMessage author role.
parts: Vec<Part>Ordered message parts.
metadata: Option<JsonObject>Optional message metadata.
extensions: Vec<String>Extension URIs attached to the message.
reference_task_ids: Vec<String>Related task identifiers referenced by the message.
Implementations§
Source§impl Message
impl Message
Sourcepub fn auth_required_metadata(
&self,
) -> Result<Option<AuthRequiredMetadata>, A2AError>
pub fn auth_required_metadata( &self, ) -> Result<Option<AuthRequiredMetadata>, A2AError>
Parse TASK_STATE_AUTH_REQUIRED metadata from this message, if present.
This helper is intended for messages already known to participate in the
auth-required flow. If metadata exists but does not match the
AuthRequiredMetadata schema, this returns Err rather than Ok(None).
Sourcepub fn set_auth_required_metadata(
&mut self,
metadata: AuthRequiredMetadata,
) -> Result<(), A2AError>
pub fn set_auth_required_metadata( &mut self, metadata: AuthRequiredMetadata, ) -> Result<(), A2AError>
Replace this message’s metadata with the auth-required convention payload.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Message
impl<'de> Deserialize<'de> for Message
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
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