use crate::Reply;
#[derive(Debug, Clone, PartialEq, Eq, strum::AsRefStr, serde::Deserialize, serde::Serialize)]
#[strum(serialize_all = "snake_case")]
pub enum Status {
Accept(Reply),
Next,
Deny(Reply),
Faccept(Reply),
Quarantine(String),
#[serde(skip)]
Delegated(SmtpConnection),
DelegationResult,
}
impl Status {
#[must_use]
#[inline]
pub const fn is_finished(&self) -> bool {
matches!(
self,
Self::Faccept(_) | Self::Deny(_) | Self::Quarantine(_) | Self::Delegated(_)
)
}
}
#[derive(Clone)]
pub struct SmtpConnection(pub alloc::sync::Arc<std::sync::Mutex<lettre::SmtpTransport>>);
impl Eq for SmtpConnection {}
impl PartialEq for SmtpConnection {
#[inline]
fn eq(&self, _: &Self) -> bool {
false
}
}
impl core::fmt::Debug for SmtpConnection {
#[inline]
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
f.debug_tuple("SmtpTransport").finish()
}
}