nyquest_interface/async/
body.rs1use futures_io::{AsyncRead, AsyncSeek};
6
7#[doc(hidden)]
9pub trait BodyStream: AsyncRead + AsyncSeek + Send {}
10
11#[doc(hidden)]
13pub type BoxedStream = Box<dyn BodyStream>;
14
15pub type Body = crate::body::Body<BoxedStream>;
17
18impl Body {
19 #[doc(hidden)]
21 pub fn stream<S: AsyncRead + AsyncSeek + Send + 'static>(
22 stream: S,
23 content_length: Option<u64>,
24 ) -> Self {
25 crate::body::Body::Stream(crate::body::StreamReader {
26 stream: Box::new(stream),
27 content_length,
28 })
29 }
30}
31
32impl<S: AsyncRead + AsyncSeek + Send + ?Sized> BodyStream for S {}