pub enum DirectBody {
Stated(Vec<u8>),
Produced(Pin<Box<dyn Stream<Item = Result<Vec<u8>, Error>> + Send>>),
}Expand description
What an answer carries, which is either bytes already in hand or bytes still to come.
This interpretation carries no transport, so a body produced over time is carried as what produces it. Whatever moves bytes drives it, and anything reading the answer whole collects it.
Variants§
Stated(Vec<u8>)
Bytes that are already there.
Produced(Pin<Box<dyn Stream<Item = Result<Vec<u8>, Error>> + Send>>)
Bytes produced over time, and what produces them.
Trait Implementations§
Source§impl Debug for DirectBody
impl Debug for DirectBody
Source§impl Default for DirectBody
impl Default for DirectBody
Source§fn default() -> DirectBody
fn default() -> DirectBody
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl !RefUnwindSafe for DirectBody
impl !Sync for DirectBody
impl !UnwindSafe for DirectBody
impl Freeze for DirectBody
impl Send for DirectBody
impl Unpin for DirectBody
impl UnsafeUnpin for DirectBody
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
Source§impl<This> HttpProgramExt<This> for This
impl<This> HttpProgramExt<This> for This
Source§fn compile_http<Program>(
&self,
program: Program,
) -> <Program as HttpProgramAlg<This>>::Routewhere
Program: HttpProgramAlg<This>,
fn compile_http<Program>(
&self,
program: Program,
) -> <Program as HttpProgramAlg<This>>::Routewhere
Program: HttpProgramAlg<This>,
Compiles a named HTTP program with this interpreter.