io_smtp/rfc5321/types/
parameter.rs1use core::fmt;
7
8use alloc::borrow::Cow;
9
10use bounded_static_derive::ToStatic;
11
12use crate::rfc5321::SmtpAtom;
13
14#[derive(Debug, Clone, PartialEq, Eq, Hash, ToStatic)]
16pub struct SmtpParameter<'a> {
17 pub keyword: SmtpAtom<'a>,
19 pub value: Option<Cow<'a, str>>,
21}
22
23impl fmt::Display for SmtpParameter<'_> {
24 fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
25 match &self.value {
26 Some(value) => write!(f, "{}={}", self.keyword, value),
27 None => write!(f, "{}", self.keyword),
28 }
29 }
30}