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§
Sourcetype Stream: Send
type Stream: Send
Represents a stream that the proxy client operates on (sends protocol data over it)
Sourcetype ProxyStream: Send
type ProxyStream: Send
Represents the actual proxy stream, returned by the connect function
Required Methods§
Sourcefn 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,
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
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".