[−][src]Struct izanami_http::body::Body
An implementation of HttpBody
for general purpose.
Methods
impl Body
[src]
pub fn empty() -> Self
[src]
Creates an empty Body
.
pub fn wrap_stream<S>(stream: S) -> Self where
S: Stream<Item = Data> + Send + 'static,
S::Error: Into<Box<dyn Error + Send + Sync + 'static>>,
[src]
S: Stream<Item = Data> + Send + 'static,
S::Error: Into<Box<dyn Error + Send + Sync + 'static>>,
Wraps a Stream
into a Body
.
pub fn wrap_buf_stream<S>(buf_stream: S) -> Self where
S: BufStream + Send + 'static,
S::Item: Send + 'static,
S::Error: Into<Box<dyn Error + Send + Sync + 'static>>,
[src]
S: BufStream + Send + 'static,
S::Item: Send + 'static,
S::Error: Into<Box<dyn Error + Send + Sync + 'static>>,
Wraps a BufStream
into a Body
.
Trait Implementations
impl HttpBody for Body
[src]
type Data = Data
The type of bytes generated by this body.
type Error = Error
The error type that will be returned from this body.
fn poll_data(&mut self) -> Poll<Option<Self::Data>, Self::Error>
[src]
fn size_hint(&self) -> SizeHint
[src]
fn poll_trailers(&mut self) -> Poll<Option<HeaderMap>, Self::Error>
[src]
fn is_end_stream(&self) -> bool
[src]
fn content_length(&self) -> Option<u64>
[src]
impl<I> HttpUpgrade<I> for Body
[src]
type Upgraded = Empty<(), Self::Error>
The type of asynchronous process that drives upgraded protocol.
type Error = Error
The error type that will be returned from the upgraded stream.
fn upgrade(self, stream: I) -> Result<Self::Upgraded, I>
[src]
impl Default for Body
[src]
impl From<()> for Body
[src]
impl From<&'static str> for Body
[src]
impl From<&'static [u8]> for Body
[src]
fn from(body: &'static [u8]) -> Self
[src]
impl From<String> for Body
[src]
impl From<Vec<u8>> for Body
[src]
impl From<Bytes> for Body
[src]
impl Debug for Body
[src]
Auto Trait Implementations
Blanket Implementations
impl<T> HttpBody for T where
T: BufStream,
[src]
T: BufStream,
type Data = <T as BufStream>::Item
The type of bytes generated by this body.
type Error = <T as BufStream>::Error
The error type that will be returned from this body.
fn poll_data(
&mut Self
) -> Result<Async<Option<<T as HttpBody>::Data>>, <T as HttpBody>::Error>
[src]
&mut Self
) -> Result<Async<Option<<T as HttpBody>::Data>>, <T as HttpBody>::Error>
fn size_hint(&Self) -> SizeHint
[src]
fn poll_trailers(
&mut Self
) -> Result<Async<Option<HeaderMap<HeaderValue>>>, <T as HttpBody>::Error>
[src]
&mut Self
) -> Result<Async<Option<HeaderMap<HeaderValue>>>, <T as HttpBody>::Error>
fn is_end_stream(&Self) -> bool
[src]
fn content_length(&self) -> Option<u64>
[src]
Returns the length of total bytes contained in this body.
impl<T> HttpBodyExt for T where
T: HttpBody,
[src]
T: HttpBody,
fn into_buf_stream(self) -> IntoBufStream<Self> where
Self: Sized,
[src]
Self: Sized,
Lift this body into a BufStream
.
impl<Bd, I> HttpUpgrade for Bd where
Bd: BufStream,
[src]
Bd: BufStream,
type Upgraded = Empty<(), Error>
The type of asynchronous process that drives upgraded protocol.
type Error = Error
The error type that will be returned from the upgraded stream.
fn upgrade(Self, I) -> Result<<Bd as HttpUpgrade<I>>::Upgraded, I>
[src]
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From for T
[src]
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,