Connect

Trait Connect 

Source
pub trait Connect {
    type Future: Future;

    // Required method
    fn connect(&mut self, address: SocketAddr) -> Self::Future;
}
Expand description

This is a trait that is used for establishing a connection

Usually just passing a closure is good enough

Required Associated Types§

Source

type Future: Future

A future retuned by connect method

Required Methods§

Source

fn connect(&mut self, address: SocketAddr) -> Self::Future

Establish a connection to the specified address

Implementors§

Source§

impl<T, F> Connect for T
where T: FnMut(SocketAddr) -> F, F: IntoFuture,