Struct Message
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<Value>,
pub extensions: Vec<String>,
pub reference_task_ids: Vec<String>,
}Expand description
A2A Message (proto message Message) — one unit of client/server
communication. messageId and role are spec-REQUIRED on send, and
parts MUST contain at least one Part (spec §5.7 REQUIRED — a list
field with REQUIRED behavior must have ≥1 element).
Fields§
§message_id: String§context_id: Option<String>§task_id: Option<String>§role: Role§parts: Vec<Part>§metadata: Option<Value>§extensions: Vec<String>§reference_task_ids: Vec<String>Trait Implementations§
Source§impl<'de> Deserialize<'de> for Message
impl<'de> Deserialize<'de> for Message
Source§fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
Enforce spec REQUIRED invariants: role must not be ROLE_UNSPECIFIED
(the 0-value means “not set”), and parts must be non-empty (≥1 Part).
A missing messageId/role/parts field fails at the serde level
(no #[serde(default)]); this layer rejects present-but-empty values.
Source§impl JsonSchema for Message
impl JsonSchema for Message
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Returns a string that uniquely identifies the schema produced by this type. Read more
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Generates a JSON Schema for this type. Read more
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
Whether JSON Schemas generated for this type should be included directly in parent schemas,
rather than being re-used where possible using the
$ref keyword. Read moreimpl 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