Trait ProxyConstructor

Source
pub trait ProxyConstructor {
    type Stream: Send;
    type ProxyStream: Send;
    type ErrorKind;

    // Required method
    fn connect<'life0, 'async_trait>(
        &'life0 mut self,
        stream: Self::Stream,
    ) -> Pin<Box<dyn Future<Output = Result<Self::ProxyStream, Self::ErrorKind>> + Send + 'async_trait>>
       where Self: Sized + 'async_trait,
             'life0: 'async_trait;
}
Expand description

A general trait that represents something that constructs a proxy stream, something, where we can write to and read from just as from a usual stream but through a proxy

Required Associated Types§

Source

type Stream: Send

Represents a stream that the proxy client operates on (sends protocol data over it)

Source

type ProxyStream: Send

Represents the actual proxy stream, returned by the connect function

Source

type ErrorKind

Used for internal proxy error indication

Required Methods§

Source

fn connect<'life0, 'async_trait>( &'life0 mut self, stream: Self::Stream, ) -> Pin<Box<dyn Future<Output = Result<Self::ProxyStream, Self::ErrorKind>> + Send + 'async_trait>>
where Self: Sized + 'async_trait, 'life0: 'async_trait,

Takes ownership of an existant stream, establishes a proxixied connection on the stream and returns the proxy stream if the connection was successful, unless an error

Implementors§