pub struct Accepting<I, O, RNG, K = SecretKey> { /* private fields */ }Expand description
accept incoming handshake
upon opening an ASMTP session with our node, the initiator will send the initial handshake to authenticate themselves and the responser is required to respond accordingly.
This object offers the necessary tooling to identify the initiator so it is possible to deny the connection early enough (see Accepting::accept)
Implementations§
Source§impl<I, O, K, RNG> Accepting<I, O, RNG, K>
impl<I, O, K, RNG> Accepting<I, O, RNG, K>
Sourcepub async fn accept<F>(self, k: &K, check_id: F) -> Result<Handle<I, O>>
pub async fn accept<F>(self, k: &K, check_id: F) -> Result<Handle<I, O>>
perform the initial handshake with the peer
Upon receiving the initial handshake message, the function check_id will
verify the public key of the user. For example the user can maintain a list
of unwelcome public keys.
If the peer is accepted and is using a supported version of the protocol then the functions replies the response handshake.
§Errors
This function may fail for IO operations as well as for processing the noise handshake.