Struct smtp_proto::Response
source · pub struct Response<T: Display> {
pub code: u16,
pub esc: [u8; 3],
pub message: T,
}
Fields§
§code: u16
§esc: [u8; 3]
§message: T
Implementations§
source§impl<T: Display> Response<T>
impl<T: Display> Response<T>
pub fn new(code: u16, e0: u8, e1: u8, e2: u8, message: T) -> Self
sourcepub fn severity(&self) -> Severity
pub fn severity(&self) -> Severity
Returns the status severity (first digit of the status code).
sourcepub fn category(&self) -> Category
pub fn category(&self) -> Category
Returns the status category (second digit of the status code).
sourcepub fn is_positive_completion(&self) -> bool
pub fn is_positive_completion(&self) -> bool
Returns true
if the reply is a positive completion.
pub fn explain_class_code(&self) -> Option<(&'static str, &'static str)>
pub fn explain_subject_code(&self) -> Option<(&'static str, &'static str)>
pub fn explain_status_code(&self) -> Option<(&'static str, &'static str)>
Trait Implementations§
source§impl<T: PartialEq + Display> PartialEq for Response<T>
impl<T: PartialEq + Display> PartialEq for Response<T>
impl<T: Eq + Display> Eq for Response<T>
impl<T: Display> StructuralPartialEq for Response<T>
Auto Trait Implementations§
impl<T> Freeze for Response<T>where
T: Freeze,
impl<T> RefUnwindSafe for Response<T>where
T: RefUnwindSafe,
impl<T> Send for Response<T>where
T: Send,
impl<T> Sync for Response<T>where
T: Sync,
impl<T> Unpin for Response<T>where
T: Unpin,
impl<T> UnwindSafe for Response<T>where
T: UnwindSafe,
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more