[−][src]Struct stream_body::StreamBody
Methods
impl StreamBody
[src]
pub fn empty() -> StreamBody
[src]
Creates an empty body.
pub fn channel() -> (PipeWriter, StreamBody)
[src]
Creates a body stream with an associated writer half.
Useful when wanting to stream chunks from another thread.
pub fn channel_with_capacity(capacity: usize) -> (PipeWriter, StreamBody)
[src]
Creates a body stream with an associated writer half having a specific size of internal buffer.
Useful when wanting to stream chunks from another thread.
pub fn from_reader<R: AsyncRead + Unpin + Send + 'static>(r: R) -> StreamBody
[src]
A helper method to convert an AsyncRead to a StreamBody
. If there is any error
thrown during the reading/writing, it will be logged via log::error!.
Trait Implementations
impl Body for StreamBody
[src]
type Data = StreamData
Values yielded by the Body
.
type Error = Error
The error type this Body
might generate.
fn poll_data(
self: Pin<&mut Self>,
cx: &mut Context
) -> Poll<Option<Result<Self::Data, Self::Error>>>
[src]
self: Pin<&mut Self>,
cx: &mut Context
) -> Poll<Option<Result<Self::Data, Self::Error>>>
fn poll_trailers(
self: Pin<&mut Self>,
_cx: &mut Context
) -> Poll<Result<Option<HeaderMap<HeaderValue>>, Self::Error>>
[src]
self: Pin<&mut Self>,
_cx: &mut Context
) -> Poll<Result<Option<HeaderMap<HeaderValue>>, Self::Error>>
fn is_end_stream(&self) -> bool
[src]
fn size_hint(&self) -> SizeHint
[src]
fn data(&mut self) -> Data<Self> where
Self: Unpin,
[src]
Self: Unpin,
fn trailers(&mut self) -> Trailers<Self> where
Self: Unpin,
[src]
Self: Unpin,
impl From<&'static [u8]> for StreamBody
[src]
fn from(slice: &'static [u8]) -> StreamBody
[src]
impl From<&'static str> for StreamBody
[src]
fn from(slice: &'static str) -> StreamBody
[src]
impl From<Bytes> for StreamBody
[src]
fn from(chunk: Bytes) -> StreamBody
[src]
impl From<Cow<'static, [u8]>> for StreamBody
[src]
impl From<Cow<'static, str>> for StreamBody
[src]
fn from(cow: Cow<'static, str>) -> StreamBody
[src]
impl From<String> for StreamBody
[src]
fn from(s: String) -> StreamBody
[src]
impl From<Vec<u8>> for StreamBody
[src]
fn from(vec: Vec<u8>) -> StreamBody
[src]
Auto Trait Implementations
impl RefUnwindSafe for StreamBody
impl Send for StreamBody
impl Sync for StreamBody
impl Unpin for StreamBody
impl UnwindSafe for StreamBody
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,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[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.
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>,