pub enum ProxyYield {
WantsRead(usize),
WantsWrite(Vec<u8>),
}Available on crate features
http or socks5 only.Expand description
I/O request emitted by a yielded coroutine step.
WantsRead carries an exact byte count rather than an open-ended
“read some”: the pump reads exactly that many bytes (e.g. via
read_exact) and never consumes tunnel payload that arrives right
after the handshake. Length-framed protocols (SOCKS5) request whole
messages; delimiter-framed ones (HTTP CONNECT) request one byte at a
time while scanning.
Variants§
WantsRead(usize)
The coroutine wants exactly this many bytes read from the stream and handed back on the next resume.
WantsWrite(Vec<u8>)
The coroutine wants these bytes written to the stream.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ProxyYield
impl RefUnwindSafe for ProxyYield
impl Send for ProxyYield
impl Sync for ProxyYield
impl Unpin for ProxyYield
impl UnsafeUnpin for ProxyYield
impl UnwindSafe for ProxyYield
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more