Skip to main content

leyline/core/multipart/
debug.rs

1use std::fmt;
2
3use super::{Form, Part};
4use crate::trace::masked;
5
6impl fmt::Debug for Part {
7    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
8        f.debug_struct("Part")
9            .field("name", &self.name)
10            .field("filename", &self.filename)
11            .field("mime", &self.mime)
12            .field("body", &self.body)
13            .field(
14                "headers",
15                &masked(
16                    self.extra_headers
17                        .iter()
18                        .map(|(k, v)| (k.as_str(), v.as_bytes())),
19                ),
20            )
21            .finish()
22    }
23}
24
25impl fmt::Debug for Form {
26    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
27        f.debug_struct("Form")
28            .field("boundary", &self.boundary)
29            .field("parts", &self.parts)
30            .finish()
31    }
32}