Skip to content

Commit 6d3cbe9

Browse files
committed
add Body::set_mime and make Body::mime public
1 parent 768fc9a commit 6d3cbe9

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/body.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -405,9 +405,15 @@ impl Body {
405405
self.length.map(|length| length == 0)
406406
}
407407

408-
pub(crate) fn mime(&self) -> &Mime {
408+
/// Returns the mime type of this Body.
409+
pub fn mime(&self) -> &Mime {
409410
&self.mime
410411
}
412+
413+
/// Sets the mime type of this Body.
414+
pub fn set_mime(&mut self, mime: impl Into<Mime>) {
415+
self.mime = mime.into();
416+
}
411417
}
412418

413419
impl Debug for Body {

0 commit comments

Comments
 (0)