Skip to content

Commit

Permalink
feat: Expose streaming as public API
Browse files Browse the repository at this point in the history
Signed-off-by: Xuanwo <[email protected]>
  • Loading branch information
Xuanwo committed Apr 22, 2024
1 parent 5806063 commit 6d1af6a
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions src/async_impl/body.rs
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,20 @@ impl Body {
}
}

// pub?
pub(crate) fn streaming<B>(inner: B) -> Body
/// Wrap a [`HttpBody`] in a box inside `Body`.
///
/// # Example
///
/// ```
/// # use reqwest::Body;
/// # use futures_util;
/// # fn main() {
/// let content = "hello,world!".to_string();
///
/// let body = Body::streaming(content);
/// # }
/// ```
pub fn streaming<B>(inner: B) -> Body
where
B: HttpBody + Send + Sync + 'static,
B::Data: Into<Bytes>,
Expand Down

0 comments on commit 6d1af6a

Please sign in to comment.