Trait bip_handshake::Transport [] [src]

pub trait Transport {
    type Socket: AsyncRead + AsyncWrite + 'static;
    type FutureSocket: Future<Item=Self::Socket, Error=Error> + 'static;
    type Listener: Stream<Item=(Self::Socket, SocketAddr), Error=Error> + LocalAddr + 'static;
    fn connect(addr: &SocketAddr, handle: &Handle) -> Result<Self::FutureSocket>;
    fn listen(addr: &SocketAddr, handle: &Handle) -> Result<Self::Listener>;
}

Trait for initializing connections over an abstract Transport.

Associated Types

Concrete socket.

Future Self::Socket.

Concrete listener.

Required Methods

Connect to the given address over this transport, using the supplied Handle.

Listen to the given address for this transport, using the supplied Handle.

Implementors