Struct vsmtp_common::Reply
pub struct Reply { /* private fields */ }Expand description
SMTP message send by the server to the client as defined in RFC5321#4.2
Implementations§
§impl Reply
impl Reply
pub fn lines(&self) -> impl Iterator<Item = &String>
pub fn lines(&self) -> impl Iterator<Item = &String>
Return the reply received, with no ReplyCode, no ending CRLF
pub fn extended(self, other: &Self) -> Self
pub fn extended(self, other: &Self) -> Self
Create a new reply with:
text=self.text+other.textcode=other.code
let first = "454 TLS not available due to temporary reason".parse::<Reply>().unwrap();
let second = "451 Too many errors from the client".parse::<Reply>().unwrap();
assert_eq!(
first.extended(&second).to_string(),
[
"451-TLS not available due to temporary reason\r\n",
"451 Too many errors from the client\r\n"
].concat()
);Trait Implementations§
§impl<'de> Deserialize<'de> for Reply
impl<'de> Deserialize<'de> for Reply
§fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more