Trait rings_core::swarm::impls::ConnectionHandshake
source · pub trait ConnectionHandshake {
// Required methods
fn prepare_connection_offer<'life0, 'async_trait>(
&'life0 self,
peer: Did
) -> Pin<Box<dyn Future<Output = Result<(Connection, ConnectNodeSend)>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn answer_remote_connection<'life0, 'life1, 'async_trait>(
&'life0 self,
peer: Did,
offer_msg: &'life1 ConnectNodeSend
) -> Pin<Box<dyn Future<Output = Result<(Connection, ConnectNodeReport)>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn accept_remote_connection<'life0, 'life1, 'async_trait>(
&'life0 self,
peer: Did,
answer_msg: &'life1 ConnectNodeReport
) -> Pin<Box<dyn Future<Output = Result<Connection>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn create_offer<'life0, 'async_trait>(
&'life0 self,
peer: Did
) -> Pin<Box<dyn Future<Output = Result<(Connection, MessagePayload<Message>)>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn answer_offer<'life0, 'async_trait>(
&'life0 self,
offer_payload: MessagePayload<Message>
) -> Pin<Box<dyn Future<Output = Result<(Connection, MessagePayload<Message>)>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn accept_answer<'life0, 'async_trait>(
&'life0 self,
answer_payload: MessagePayload<Message>
) -> Pin<Box<dyn Future<Output = Result<(Did, Connection)>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
}Expand description
ConnectionHandshake defined how to connect two connections between two swarms.
Required Methods§
sourcefn prepare_connection_offer<'life0, 'async_trait>(
&'life0 self,
peer: Did
) -> Pin<Box<dyn Future<Output = Result<(Connection, ConnectNodeSend)>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn prepare_connection_offer<'life0, 'async_trait>( &'life0 self, peer: Did ) -> Pin<Box<dyn Future<Output = Result<(Connection, ConnectNodeSend)>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,
Create new connection and its offer.
sourcefn answer_remote_connection<'life0, 'life1, 'async_trait>(
&'life0 self,
peer: Did,
offer_msg: &'life1 ConnectNodeSend
) -> Pin<Box<dyn Future<Output = Result<(Connection, ConnectNodeReport)>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn answer_remote_connection<'life0, 'life1, 'async_trait>( &'life0 self, peer: Did, offer_msg: &'life1 ConnectNodeSend ) -> Pin<Box<dyn Future<Output = Result<(Connection, ConnectNodeReport)>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,
Answer the offer of remote connection.
sourcefn accept_remote_connection<'life0, 'life1, 'async_trait>(
&'life0 self,
peer: Did,
answer_msg: &'life1 ConnectNodeReport
) -> Pin<Box<dyn Future<Output = Result<Connection>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn accept_remote_connection<'life0, 'life1, 'async_trait>( &'life0 self, peer: Did, answer_msg: &'life1 ConnectNodeReport ) -> Pin<Box<dyn Future<Output = Result<Connection>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,
Accept the answer of remote connection.
sourcefn create_offer<'life0, 'async_trait>(
&'life0 self,
peer: Did
) -> Pin<Box<dyn Future<Output = Result<(Connection, MessagePayload<Message>)>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn create_offer<'life0, 'async_trait>( &'life0 self, peer: Did ) -> Pin<Box<dyn Future<Output = Result<(Connection, MessagePayload<Message>)>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,
Creaet new connection and its answer. This function will wrap the offer inside a payload with verification.
sourcefn answer_offer<'life0, 'async_trait>(
&'life0 self,
offer_payload: MessagePayload<Message>
) -> Pin<Box<dyn Future<Output = Result<(Connection, MessagePayload<Message>)>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn answer_offer<'life0, 'async_trait>( &'life0 self, offer_payload: MessagePayload<Message> ) -> Pin<Box<dyn Future<Output = Result<(Connection, MessagePayload<Message>)>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,
Answer the offer of remote connection. This function will verify the answer payload and will wrap the answer inside a payload with verification.
sourcefn accept_answer<'life0, 'async_trait>(
&'life0 self,
answer_payload: MessagePayload<Message>
) -> Pin<Box<dyn Future<Output = Result<(Did, Connection)>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn accept_answer<'life0, 'async_trait>( &'life0 self, answer_payload: MessagePayload<Message> ) -> Pin<Box<dyn Future<Output = Result<(Did, Connection)>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,
Accept the answer of remote connection. This function will verify the answer payload and will return its did with the connection.