pub struct AgentMessage {Show 13 fields
pub message_id: MessageId,
pub from_agent_id: AgentId,
pub to: Option<AgentTarget>,
pub message_type: MessageType,
pub payload: String,
pub trajectory_id: Option<TrajectoryId>,
pub scope_id: Option<ScopeId>,
pub artifact_ids: Vec<ArtifactId>,
pub created_at: Timestamp,
pub delivered_at: Option<Timestamp>,
pub acknowledged_at: Option<Timestamp>,
pub priority: MessagePriority,
pub expires_at: Option<Timestamp>,
}Expand description
A message between agents.
Fields§
§message_id: MessageId§from_agent_id: AgentId§to: Option<AgentTarget>Recipient: specific agent (by_id) or any agent of a type (by_type).
message_type: MessageType§payload: String§trajectory_id: Option<TrajectoryId>§scope_id: Option<ScopeId>§artifact_ids: Vec<ArtifactId>§created_at: Timestamp§delivered_at: Option<Timestamp>§acknowledged_at: Option<Timestamp>§priority: MessagePriority§expires_at: Option<Timestamp>Implementations§
Source§impl AgentMessage
impl AgentMessage
Sourcepub fn to_agent(
from: AgentId,
to: AgentId,
msg_type: MessageType,
payload: &str,
) -> Self
pub fn to_agent( from: AgentId, to: AgentId, msg_type: MessageType, payload: &str, ) -> Self
Create a message to a specific agent.
Sourcepub fn to_type(
from: AgentId,
agent_type: impl Into<AgentType>,
msg_type: MessageType,
payload: &str,
) -> Self
pub fn to_type( from: AgentId, agent_type: impl Into<AgentType>, msg_type: MessageType, payload: &str, ) -> Self
Create a message to an agent type.
Sourcepub fn with_trajectory(self, trajectory_id: TrajectoryId) -> Self
pub fn with_trajectory(self, trajectory_id: TrajectoryId) -> Self
Associate with trajectory.
Sourcepub fn with_scope(self, scope_id: ScopeId) -> Self
pub fn with_scope(self, scope_id: ScopeId) -> Self
Associate with scope.
Sourcepub fn with_artifacts(self, artifacts: Vec<ArtifactId>) -> Self
pub fn with_artifacts(self, artifacts: Vec<ArtifactId>) -> Self
Add artifacts.
Sourcepub fn with_priority(self, priority: MessagePriority) -> Self
pub fn with_priority(self, priority: MessagePriority) -> Self
Set priority.
Sourcepub fn mark_delivered(&mut self)
pub fn mark_delivered(&mut self)
Mark as delivered.
Sourcepub fn mark_acknowledged(&mut self)
pub fn mark_acknowledged(&mut self)
Mark as acknowledged.
Sourcepub fn is_for_agent(&self, agent_id: AgentId) -> bool
pub fn is_for_agent(&self, agent_id: AgentId) -> bool
Check if message is for a specific agent.
Trait Implementations§
Source§impl Clone for AgentMessage
impl Clone for AgentMessage
Source§fn clone(&self) -> AgentMessage
fn clone(&self) -> AgentMessage
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 ComposeSchema for AgentMessage
impl ComposeSchema for AgentMessage
Source§impl Debug for AgentMessage
impl Debug for AgentMessage
Source§impl<'de> Deserialize<'de> for AgentMessage
impl<'de> Deserialize<'de> for AgentMessage
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
Source§impl PartialEq for AgentMessage
impl PartialEq for AgentMessage
Source§impl Serialize for AgentMessage
impl Serialize for AgentMessage
Source§impl ToSchema for AgentMessage
impl ToSchema for AgentMessage
impl StructuralPartialEq for AgentMessage
Auto Trait Implementations§
impl Freeze for AgentMessage
impl RefUnwindSafe for AgentMessage
impl Send for AgentMessage
impl Sync for AgentMessage
impl Unpin for AgentMessage
impl UnwindSafe for AgentMessage
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