[][src]Trait networking::ConnectionRequest

pub trait ConnectionRequest {
    type Error: Error;
    type NetStream;
    fn new(stream: Self::NetStream) -> Self;
fn verify<L: PeerList>(
        self,
        list: &L
    ) -> Result<Self::NetStream, Self::Error>;
unsafe fn unverify(self) -> Self::NetStream; }

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

Associated Types

Loading content...

Required methods

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

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

used to ensure only known peers are allow to connect

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

Loading content...

Implementors

impl<T: AsyncDataStream> ConnectionRequest for AsyncRequest<T>[src]

type Error = NetworkError

type NetStream = T

impl<T: SyncDataStream> ConnectionRequest for SyncRequest<T>[src]

type Error = NetworkError

type NetStream = T

Loading content...