pub struct Response {
pub code: u16,
pub enhanced_code: Option<EnhancedStatusCode>,
pub content: String,
pub command: Option<String>,
}
Fields§
§code: u16
§enhanced_code: Option<EnhancedStatusCode>
§content: String
§command: Option<String>
Implementations§
Source§impl Response
impl Response
pub fn to_single_line(&self) -> String
pub fn is_transient(&self) -> bool
pub fn is_permanent(&self) -> bool
pub fn with_code_and_message(code: u16, message: &str) -> Self
Sourcepub fn was_due_to_message(&self) -> bool
pub fn was_due_to_message(&self) -> bool
If the error contents were likely caused by something about the mostly recently attempted message, rather than a transport issue, or a carry-over from a prior message (eg: previous message was rejected and destination chose to drop the connection, which we detect later in RSET on the next message), then we return true. The expectation is that the caller will transiently fail the message for later retry. If we return false then the caller might decide to try that same message again more immediately on a separate connection
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Response
impl<'de> Deserialize<'de> for Response
Source§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
impl Eq for Response
impl StructuralPartialEq for Response
Auto Trait Implementations§
impl Freeze for Response
impl RefUnwindSafe for Response
impl Send for Response
impl Sync for Response
impl Unpin for Response
impl UnwindSafe for Response
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more