pub struct Connect {
pub transaction_id: Option<String>,
pub agent_id: Option<String>,
pub agent: Option<ConnectAgent>,
pub principal: Option<Party>,
pub for_: Option<String>,
pub role: Option<String>,
pub constraints: Option<ConnectionConstraints>,
}Expand description
Connect message body (TAIP-2).
Fields§
§transaction_id: Option<String>Transaction ID (only available after creation).
agent_id: Option<String>Agent DID (kept for backward compatibility).
agent: Option<ConnectAgent>Agent object containing agent details.
principal: Option<Party>Principal party this connection is for.
for_: Option<String>The entity this connection is for (kept for backward compatibility).
role: Option<String>The role of the agent (optional).
constraints: Option<ConnectionConstraints>Connection constraints (optional).
Implementations§
Source§impl Connect
impl Connect
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 (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.
Trait Implementations§
Source§impl Authorizable for Connect
impl Authorizable for Connect
Source§impl Connectable for Connect
impl Connectable for Connect
Source§fn with_connection(&mut self, _connection_id: &str) -> &mut Self
fn with_connection(&mut self, _connection_id: &str) -> &mut Self
Connect this message to a prior Connect message by setting the parent thread ID (pthid). Read more
Source§fn has_connection(&self) -> bool
fn has_connection(&self) -> bool
Check if this message is connected to a prior Connect message. Read more
Source§impl<'de> Deserialize<'de> for Connect
impl<'de> Deserialize<'de> for Connect
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 MessageContext for Connect
impl MessageContext for Connect
Source§fn participant_dids(&self) -> Vec<String>
fn participant_dids(&self) -> Vec<String>
Extract all participant DIDs from the message
This replaces the old participants() method and works with Agent/Party types directly
Source§fn transaction_context(&self) -> Option<TransactionContext>
fn transaction_context(&self) -> Option<TransactionContext>
Get transaction context if applicable
Source§fn routing_hints(&self) -> RoutingHints
fn routing_hints(&self) -> RoutingHints
Get routing hints for message delivery
Source§fn transaction_id(&self) -> Option<String>
fn transaction_id(&self) -> Option<String>
Get transaction ID if available
Source§impl TapMessage for Connect
impl TapMessage for Connect
Source§fn is_tap_message(&self) -> bool
fn is_tap_message(&self) -> bool
Checks if this message is a TAP message.
Source§fn get_tap_type(&self) -> Option<String>
fn get_tap_type(&self) -> Option<String>
Gets the TAP message type from this message.
Source§fn body_as<T: TapMessageBody>(&self) -> Result<T>
fn body_as<T: TapMessageBody>(&self) -> Result<T>
Extract a specific message body type from this message. Read more
Source§fn get_all_participants(&self) -> Vec<String>
fn get_all_participants(&self) -> Vec<String>
Get all participant DIDs from this message. Read more
Source§fn create_reply<T: TapMessageBody>(
&self,
body: &T,
creator_did: &str,
) -> Result<PlainMessage>
fn create_reply<T: TapMessageBody>( &self, body: &T, creator_did: &str, ) -> Result<PlainMessage>
Create a reply to this message. Read more
Source§fn parent_thread_id(&self) -> Option<&str>
fn parent_thread_id(&self) -> Option<&str>
Get the parent thread ID for this message
Source§fn message_id(&self) -> &str
fn message_id(&self) -> &str
Get the message ID for this message
Source§impl TapMessageBody for Connect
impl TapMessageBody for Connect
Source§fn message_type() -> &'static str
fn message_type() -> &'static str
Get the message type string for this body type.
Source§fn to_didcomm(&self, from_did: &str) -> Result<PlainMessage>
fn to_didcomm(&self, from_did: &str) -> Result<PlainMessage>
Convert this body to a DIDComm message.
Source§fn to_didcomm_with_route<'a, I>(
&self,
from: &str,
to: I,
) -> Result<PlainMessage>where
I: IntoIterator<Item = &'a str>,
fn to_didcomm_with_route<'a, I>(
&self,
from: &str,
to: I,
) -> Result<PlainMessage>where
I: IntoIterator<Item = &'a str>,
Convert this body to a DIDComm message with a custom routing path. Read more
Source§fn from_didcomm(message: &PlainMessage) -> Result<Self>where
Self: Sized,
fn from_didcomm(message: &PlainMessage) -> Result<Self>where
Self: Sized,
Extract this body type from a DIDComm message.
Auto Trait Implementations§
impl Freeze for Connect
impl RefUnwindSafe for Connect
impl Send for Connect
impl Sync for Connect
impl Unpin for Connect
impl UnwindSafe for Connect
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