tonic::body

Type Alias BoxBody

Source
pub type BoxBody = UnsyncBoxBody<Bytes, Status>;
Expand description

A type erased HTTP body used for tonic services.

Aliased Type§

struct BoxBody { /* private fields */ }

Implementations

Source§

impl<D, E> UnsyncBoxBody<D, E>

Source

pub fn new<B>(body: B) -> UnsyncBoxBody<D, E>
where B: Body<Data = D, Error = E> + Send + 'static, D: Buf,

Create a new BoxBody.

Trait Implementations

Source§

impl<D, E> Body for UnsyncBoxBody<D, E>
where D: Buf,

Source§

type Data = D

Values yielded by the Body.
Source§

type Error = E

The error type this Body might generate.
Source§

fn poll_frame( self: Pin<&mut UnsyncBoxBody<D, E>>, cx: &mut Context<'_>, ) -> Poll<Option<Result<Frame<<UnsyncBoxBody<D, E> as Body>::Data>, <UnsyncBoxBody<D, E> as Body>::Error>>>

Attempt to pull out the next data buffer of this stream.
Source§

fn is_end_stream(&self) -> bool

Returns true when the end of stream has been reached. Read more
Source§

fn size_hint(&self) -> SizeHint

Returns the bounds on the remaining length of the stream. Read more
Source§

impl<D, E> Debug for UnsyncBoxBody<D, E>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl<D, E> Default for UnsyncBoxBody<D, E>
where D: Buf + 'static,

Source§

fn default() -> UnsyncBoxBody<D, E>

Returns the “default value” for a type. Read more