pub struct A2AMessage {
pub id: String,
pub from_agent: String,
pub to_agent: Option<String>,
pub task_id: Option<String>,
pub category: MessageCategory,
pub priority: MessagePriority,
pub privacy: PrivacyLevel,
pub content: String,
pub metadata: HashMap<String, String>,
pub timestamp: DateTime<Utc>,
pub read_by: Vec<String>,
pub expires_at: Option<DateTime<Utc>>,
}Fields§
§id: String§from_agent: String§to_agent: Option<String>§task_id: Option<String>§category: MessageCategory§priority: MessagePriority§privacy: PrivacyLevel§content: String§metadata: HashMap<String, String>§timestamp: DateTime<Utc>§read_by: Vec<String>§expires_at: Option<DateTime<Utc>>Implementations§
Source§impl A2AMessage
impl A2AMessage
pub fn new( from: &str, to: Option<&str>, category: MessageCategory, content: &str, ) -> Self
pub fn with_task(self, task_id: &str) -> Self
pub fn with_priority(self, priority: MessagePriority) -> Self
pub fn with_privacy(self, privacy: PrivacyLevel) -> Self
pub fn with_ttl_hours(self, hours: u64) -> Self
pub fn is_expired(&self) -> bool
pub fn is_visible_to(&self, agent_id: &str) -> bool
pub fn mark_read(&mut self, agent_id: &str)
Trait Implementations§
Source§impl Clone for A2AMessage
impl Clone for A2AMessage
Source§fn clone(&self) -> A2AMessage
fn clone(&self) -> A2AMessage
Returns a duplicate of the value. Read more
1.0.0 · 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 A2AMessage
impl Debug for A2AMessage
Source§impl<'de> Deserialize<'de> for A2AMessage
impl<'de> Deserialize<'de> for A2AMessage
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 A2AMessage
impl RefUnwindSafe for A2AMessage
impl Send for A2AMessage
impl Sync for A2AMessage
impl Unpin for A2AMessage
impl UnsafeUnpin for A2AMessage
impl UnwindSafe for A2AMessage
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