Trait ConnectionRequest

Source
pub trait ConnectionRequest {
    type Error: Error;
    type NetStream;

    // Required methods
    fn new(stream: Self::NetStream) -> Self;
    fn verify<L: PeerList>(
        self,
        list: &L,
    ) -> Result<Self::NetStream, Self::Error>;
    unsafe fn unverify(self) -> Self::NetStream;
}
Expand description

implemented on both async and sync connection requests structs to define how to verify a peer

Required Associated Types§

Required Methods§

Source

fn new(stream: Self::NetStream) -> Self

Source

fn verify<L: PeerList>(self, list: &L) -> Result<Self::NetStream, Self::Error>

used to ensure only known peers are allow to connect

Source

unsafe fn unverify(self) -> Self::NetStream

§Safety

this function allows unauthorized peers to connect to this device should only be used if a pair request is being run

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§