pub struct Message { /* private fields */ }Expand description
A durable, provenance-bound conversation message.
A message is not a provider request or protocol object. Adapters map its role, content, and producer to provider-specific messages, tool-result items, or A2A directionality only after capability and policy checks.
Implementations§
Source§impl Message
impl Message
Sourcepub fn new(
message_id: MessageId,
role: MessageRole,
parts: MessageParts,
provenance: MessageProvenance,
) -> Result<Self, MessageError>
pub fn new( message_id: MessageId, role: MessageRole, parts: MessageParts, provenance: MessageProvenance, ) -> Result<Self, MessageError>
Constructs and validates a durable message.
§Errors
Returns MessageError when producer attribution is incompatible with
the semantic role, or a non-artifact part’s immediate content source is
incompatible with that role.
Sourcepub const fn message_id(&self) -> MessageId
pub const fn message_id(&self) -> MessageId
Returns the tenant-scoped durable message identifier.
Sourcepub const fn role(&self) -> MessageRole
pub const fn role(&self) -> MessageRole
Returns the stable semantic role.
Sourcepub const fn parts(&self) -> &MessageParts
pub const fn parts(&self) -> &MessageParts
Returns the bounded ordered content parts.
Sourcepub const fn provenance(&self) -> &MessageProvenance
pub const fn provenance(&self) -> &MessageProvenance
Returns durable causation and producer attribution.
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
impl Eq for Message
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 Forget for Message
impl Freeze for Message
impl Move 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