(
&mut self,
name: &str,
content_type: &Mime,
mut contents: R,
)
| 74 | } |
| 75 | |
| 76 | pub fn write_field<R: std::io::Read>( |
| 77 | &mut self, |
| 78 | name: &str, |
| 79 | content_type: &Mime, |
| 80 | mut contents: R, |
| 81 | ) -> std::io::Result<&mut Self> { |
| 82 | self.write_field_header(name, content_type)?; |
| 83 | std::io::copy(&mut contents, &mut self.inner)?; |
| 84 | self.inner.write_all(b"\r\n")?; |
| 85 | Ok(self) |
| 86 | } |
| 87 | |
| 88 | pub fn write_text(&mut self, name: &str, text: &str) -> std::io::Result<&mut Self> { |
| 89 | self.write_field(name, &mime::TEXT_PLAIN, text.as_bytes()) |
no test coverage detected