pub enum UnsubscribeMethod {
OneClick {
url: Url,
},
HttpLink {
url: Url,
},
Mailto {
address: String,
subject: Option<String>,
},
None,
}Expand description
The unsubscribe action a message exposes via its headers.
Returned by parse and parse_with_post. The OneClick variant is
only produced when an RFC 8058 List-Unsubscribe-Post header is present
and an HTTPS or HTTP URL is available in the main header.
Variants§
OneClick
RFC 8058 one-click. The caller should POST to url with body
List-Unsubscribe=One-Click and Content-Type: application/x-www-form-urlencoded.
HttpLink
A plain HTTP(S) link the user should open in a browser. May require further interaction (preference page, confirmation click).
Mailto
Send an email to address with optional subject. The body, if any
was specified in the mailto: query, is intentionally dropped — see
the crate README for the rationale.
None
No List-Unsubscribe header was found, or every candidate was
unparseable.
Trait Implementations§
Source§impl Clone for UnsubscribeMethod
impl Clone for UnsubscribeMethod
Source§fn clone(&self) -> UnsubscribeMethod
fn clone(&self) -> UnsubscribeMethod
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for UnsubscribeMethod
impl Debug for UnsubscribeMethod
Source§impl<'de> Deserialize<'de> for UnsubscribeMethod
impl<'de> Deserialize<'de> for UnsubscribeMethod
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>,
impl Eq for UnsubscribeMethod
Source§impl PartialEq for UnsubscribeMethod
impl PartialEq for UnsubscribeMethod
Source§fn eq(&self, other: &UnsubscribeMethod) -> bool
fn eq(&self, other: &UnsubscribeMethod) -> bool
self and other values to be equal, and is used by ==.