Trait pea2pea::protocols::Handshaking[][src]

pub trait Handshaking: Pea2Pea where
    Self: Clone + Send + Sync + 'static, 
{ #[must_use] fn perform_handshake<'life0, 'async_trait>(
        &'life0 self,
        conn: Connection
    ) -> Pin<Box<dyn Future<Output = Result<Connection>> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        Self: 'async_trait
; fn enable_handshaking(&self) { ... } }

Can be used to specify and enable network handshakes. Upon establishing a connection, both sides will need to adhere to the specified handshake rules in order to finalize the connection and be able to send or receive any messages.

Required methods

#[must_use]fn perform_handshake<'life0, 'async_trait>(
    &'life0 self,
    conn: Connection
) -> Pin<Box<dyn Future<Output = Result<Connection>> + Send + 'async_trait>> where
    'life0: 'async_trait,
    Self: 'async_trait, 
[src]

Performs the handshake; temporarily assumes control of the Connection and returns it if the handshake is successful.

Loading content...

Provided methods

fn enable_handshaking(&self)[src]

Prepares the node to perform specified network handshakes.

Loading content...

Implementors

Loading content...