pub struct Connect {
pub transaction_id: Option<String>,
pub requester: Option<Party>,
pub principal: Option<Party>,
pub agents: Vec<Agent>,
pub constraints: Option<ConnectionConstraints>,
pub agreement: Option<String>,
pub expiry: Option<String>,
pub agent_id: Option<String>,
pub agent: Option<ConnectAgent>,
pub for_: Option<String>,
pub role: Option<String>,
}Expand description
Connect message body (TAIP-15).
Fields§
§transaction_id: Option<String>Transaction ID (only available after creation).
requester: Option<Party>Requester party (TAIP-15 v2, required for new messages).
principal: Option<Party>Principal party this connection is for.
agents: Vec<Agent>Agents involved in the connection (TAIP-5 agents).
constraints: Option<ConnectionConstraints>Connection constraints (required per TAIP-15).
agreement: Option<String>URL pointing to terms of service or agreement.
expiry: Option<String>Expiration time in ISO 8601 format.
agent_id: Option<String>Agent DID (legacy, use agents array instead).
agent: Option<ConnectAgent>Legacy agent object (use agents array instead).
for_: Option<String>Legacy entity this connection is for (use principal instead).
role: Option<String>Legacy role field (use agents with roles instead).
Implementations§
Source§impl Connect
impl Connect
Sourcepub fn new_v2(
requester: Party,
principal: Party,
agents: Vec<Agent>,
constraints: ConnectionConstraints,
) -> Self
pub fn new_v2( requester: Party, principal: Party, agents: Vec<Agent>, constraints: ConnectionConstraints, ) -> Self
Create a new Connect message with requester, principal, and agents (TAIP-15 v2).
Sourcepub fn new(
transaction_id: &str,
agent_id: &str,
for_id: &str,
role: Option<&str>,
) -> Self
pub fn new( transaction_id: &str, agent_id: &str, for_id: &str, role: Option<&str>, ) -> Self
Create a new Connect message (legacy backward compatible).
Sourcepub fn new_with_agent_and_principal(
transaction_id: &str,
agent: ConnectAgent,
principal: Party,
) -> Self
pub fn new_with_agent_and_principal( transaction_id: &str, agent: ConnectAgent, principal: Party, ) -> Self
Create a new Connect message with Agent and Principal.
Sourcepub fn with_constraints(self, constraints: ConnectionConstraints) -> Self
pub fn with_constraints(self, constraints: ConnectionConstraints) -> Self
Add constraints to the Connect message.
Sourcepub fn with_agreement(self, agreement: String) -> Self
pub fn with_agreement(self, agreement: String) -> Self
Set the agreement URL.
Sourcepub fn with_expiry(self, expiry: String) -> Self
pub fn with_expiry(self, expiry: String) -> Self
Set the expiry timestamp.