Struct lettre::smtp::response::Response
[−]
[src]
pub struct Response { pub code: Code, pub message: Vec<String>, }
Contains an SMTP reply, with separated code and message
The text message is optional, only the code is mandatory
Fields
code: Code
Response code
message: Vec<String>
Server response string (optional) Handle multiline responses
Methods
impl Response
[src]
pub fn new(code: Code, message: Vec<String>) -> Response
[src]
Creates a new Response
pub fn is_positive(&self) -> bool
[src]
Tells if the response is positive
pub fn has_code(&self, code: u16) -> bool
[src]
Tests code equality
pub fn first_word(&self) -> Option<&str>
[src]
Returns only the first word of the message if possible
pub fn first_line(&self) -> Option<&str>
[src]
Returns only the line of the message if possible
Trait Implementations
impl PartialEq for Response
[src]
fn eq(&self, __arg_0: &Response) -> bool
[src]
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &Response) -> bool
[src]
This method tests for !=
.
impl Eq for Response
[src]
impl Clone for Response
[src]
fn clone(&self) -> Response
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl Debug for Response
[src]
fn fmt(&self, __arg_0: &mut Formatter) -> Result
[src]
Formats the value using the given formatter. Read more
impl FromStr for Response
[src]
type Err = NomError
The associated error which can be returned from parsing.
fn from_str(s: &str) -> Result<Response, NomError>
[src]
Parses a string s
to return a value of this type. Read more