Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions http-body/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,16 @@ pub trait Body {
fn size_hint(&self) -> SizeHint {
SizeHint::default()
}

/// Attempt to clone this body if the concrete type supports it.
///
/// The default implementation returns `None` to indicate cloning is not supported.
fn try_clone(&self) -> Option<Self>
where
Self: Sized,
{
None
}
}

impl<T: Body + Unpin + ?Sized> Body for &mut T {
Expand Down