pub trait ProxyCoroutine {
type Yield;
type Return;
// Required method
fn resume(
&mut self,
arg: Option<&[u8]>,
) -> ProxyCoroutineState<Self::Yield, Self::Return>;
}Available on crate features
http or socks5 only.Expand description
Standard-shape proxy coroutine: owns its internal state, declares a
per-step Yield, and returns Result<Output, Error> on completion.
Required Associated Types§
Required Methods§
Sourcefn resume(
&mut self,
arg: Option<&[u8]>,
) -> ProxyCoroutineState<Self::Yield, Self::Return>
fn resume( &mut self, arg: Option<&[u8]>, ) -> ProxyCoroutineState<Self::Yield, Self::Return>
Advances one step.
Pass None initially and after every ProxyYield::WantsWrite;
pass Some(data) after a ProxyYield::WantsRead(n) with exactly
the n bytes that were read.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".
Implementors§
Source§impl ProxyCoroutine for HttpConnect
Available on crate feature http only.
impl ProxyCoroutine for HttpConnect
Available on crate feature
http only.type Yield = ProxyYield
type Return = Result<(), HttpConnectError>
Source§impl ProxyCoroutine for Socks5Connect
Available on crate feature socks5 only.
impl ProxyCoroutine for Socks5Connect
Available on crate feature
socks5 only.