pub trait HttpCoroutine {
type Yield;
type Return;
// Required method
fn resume(
&mut self,
arg: Option<&[u8]>,
) -> HttpCoroutineState<Self::Yield, Self::Return>;
}Expand description
Standard-shape HTTP coroutine: own internal state, declare per-step
Yield, return Result<Output, Error> on completion.
Required Associated Types§
Required Methods§
Sourcefn resume(
&mut self,
arg: Option<&[u8]>,
) -> HttpCoroutineState<Self::Yield, Self::Return>
fn resume( &mut self, arg: Option<&[u8]>, ) -> HttpCoroutineState<Self::Yield, Self::Return>
Advances one step. Pass None initially or after HttpYield::WantsWrite;
pass Some(data) after HttpYield::WantsRead; pass Some(&[]) for EOF.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".