Skip to main content

Method

Trait Method 

Source
pub trait Method {
    type Handshake: Handshake;

    // Required methods
    fn name(&self) -> &'static str;
    fn initiate(
        &self,
    ) -> Result<Self::Handshake, <Self::Handshake as Handshake>::Error>;
    fn respond(
        &self,
        source: Option<SocketAddr>,
    ) -> Result<Self::Handshake, <Self::Handshake as Handshake>::Error>;
}
Expand description

An authentication method: a configured factory of handshakes.

Methods are named coqui-peer-<method>; name is the <method> part and the name under which the method’s keys are kept in the trust store.

Required Associated Types§

Source

type Handshake: Handshake

The handshake this method runs.

Required Methods§

Source

fn name(&self) -> &'static str

The method name: lowercase letters, digits and -, as in KeyMaterial::method.

Source

fn initiate( &self, ) -> Result<Self::Handshake, <Self::Handshake as Handshake>::Error>

Starts a handshake as the side that dials.

§Errors

When this method is not configured to dial.

Source

fn respond( &self, source: Option<SocketAddr>, ) -> Result<Self::Handshake, <Self::Handshake as Handshake>::Error>

Starts a handshake as the side that accepts. source is where the peer connected from; it is recorded with a waiting entry.

§Errors

When this method is not configured to accept.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§