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§

source

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.

source

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.

source

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.

source

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.

source

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.

source

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.

Implementors§