mirror of
https://github.com/openharmony/third_party_rust_hyper.git
synced 2026-07-19 13:54:29 -04:00
docs(body): wrap_stream using futures_util
This commit is contained in:
committed by
Sean McArthur
parent
35887e9c29
commit
be10c466f3
+6
-7
@@ -129,17 +129,16 @@ impl Body {
|
||||
/// # Example
|
||||
///
|
||||
/// ```
|
||||
/// # extern crate futures;
|
||||
/// # extern crate hyper;
|
||||
/// # use hyper::Body;
|
||||
/// # use futures_util;
|
||||
/// # fn main() {
|
||||
/// let chunks = vec![
|
||||
/// "hello",
|
||||
/// " ",
|
||||
/// "world",
|
||||
/// let chunks: Vec<Result<_, ::std::io::Error>> = vec![
|
||||
/// Ok("hello"),
|
||||
/// Ok(" "),
|
||||
/// Ok("world"),
|
||||
/// ];
|
||||
///
|
||||
/// let stream = futures::stream::iter_ok::<_, ::std::io::Error>(chunks);
|
||||
/// let stream = futures_util::stream::iter(chunks);
|
||||
///
|
||||
/// let body = Body::wrap_stream(stream);
|
||||
/// # }
|
||||
|
||||
Reference in New Issue
Block a user