Struct hyper_simple_server::Body [−][src]
A stream of Bytes
, used when receiving bodies.
A good default HttpBody
to use in many
applications.
Implementations
impl Body
[src]
pub fn empty() -> Body
[src]
Create an empty Body
stream.
Example
use hyper::{Body, Request}; // create a `GET /` request let get = Request::new(Body::empty());
pub fn channel() -> (Sender, Body)
[src]
Create a Body
stream with an associated sender half.
Useful when wanting to stream chunks from another thread.
Trait Implementations
impl Body for Body
[src]
type Data = Bytes
Values yielded by the Body
.
type Error = Error
The error type this Body
might generate.
pub fn poll_data(
self: Pin<&mut Body>,
cx: &mut Context<'_>
) -> Poll<Option<Result<<Body as Body>::Data, <Body as Body>::Error>>>
[src]
self: Pin<&mut Body>,
cx: &mut Context<'_>
) -> Poll<Option<Result<<Body as Body>::Data, <Body as Body>::Error>>>
pub fn poll_trailers(
self: Pin<&mut Body>,
cx: &mut Context<'_>
) -> Poll<Result<Option<HeaderMap<HeaderValue>>, <Body as Body>::Error>>
[src]
self: Pin<&mut Body>,
cx: &mut Context<'_>
) -> Poll<Result<Option<HeaderMap<HeaderValue>>, <Body as Body>::Error>>
pub fn is_end_stream(&self) -> bool
[src]
pub fn size_hint(&self) -> SizeHint
[src]
pub fn data(&mut self) -> Data<'_, Self>ⓘ where
Self: Unpin,
[src]
Self: Unpin,
pub fn trailers(&mut self) -> Trailers<'_, Self>ⓘ where
Self: Unpin,
[src]
Self: Unpin,
impl Debug for Body
[src]
impl Default for Body
[src]
impl From<&'static [u8]> for Body
[src]
impl From<&'static str> for Body
[src]
impl From<Bytes> for Body
[src]
impl From<Cow<'static, [u8]>> for Body
[src]
impl From<Cow<'static, str>> for Body
[src]
impl From<String> for Body
[src]
impl From<Vec<u8, Global>> for Body
[src]
impl ResponseExtBuild<Body> for Response<Body>
[src]
fn new_with_status_and_body(
_status: StatusCode,
_content_type: Option<impl Into<HeaderValue>>,
_body: impl Into<Body>
) -> Self
[src]
_status: StatusCode,
_content_type: Option<impl Into<HeaderValue>>,
_body: impl Into<Body>
) -> Self
fn new_empty() -> Self where
B: Default,
[src]
B: Default,
fn new_200_with_body(
_content_type: Option<impl Into<HeaderValue>>,
_body: impl Into<B>
) -> Self
[src]
_content_type: Option<impl Into<HeaderValue>>,
_body: impl Into<B>
) -> Self
fn new_200_with_text(_body: impl Into<B>) -> Self
[src]
fn new_200_with_html(_body: impl Into<B>) -> Self
[src]
fn new_200() -> Self where
B: From<&'static str>,
[src]
B: From<&'static str>,
fn new_404() -> Self where
B: From<&'static str>,
[src]
B: From<&'static str>,
fn new_method_not_allowed() -> Self where
B: From<&'static str>,
[src]
B: From<&'static str>,
fn ok<E>(self) -> Result<Self, E>
[src]
fn ok_0(self) -> Result<Self, ServerError>
[src]
fn ready<E>(self) -> Ready<Result<Self, E>>
[src]
fn ready_0(self) -> Ready<Result<Self, ServerError>>
[src]
Auto Trait Implementations
impl !RefUnwindSafe for Body
[src]
impl Send for Body
[src]
impl Sync for Body
[src]
impl Unpin for Body
[src]
impl !UnwindSafe for Body
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T> Instrument for T
[src]
pub fn instrument(self, span: Span) -> Instrumented<Self>
[src]
pub fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T> Instrument for T
[src]
pub fn instrument(self, span: Span) -> Instrumented<Self>
[src]
pub fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,