pub struct Unsubscribe {
pub mailto: Option<UnsubscribeMail>,
pub links: Vec<String>,
pub one_click: bool,
}Expand description
How a sender lets a reader unsubscribe (RFC 2369, RFC 8058).
The header is written by the sender, so nothing here is trusted: tools take a message id and read this themselves, never a URL or an address from a caller.
Fields§
§mailto: Option<UnsubscribeMail>The mailto route, when the header has one that passed every check.
links: Vec<String>http and https links, in header order.
one_click: boolList-Unsubscribe-Post asks for List-Unsubscribe=One-Click and an https link exists.
Implementations§
Source§impl Unsubscribe
impl Unsubscribe
Sourcepub fn one_click_link(&self) -> Option<&str>
pub fn one_click_link(&self) -> Option<&str>
The https link a one-click POST goes to: the first one, when List-Unsubscribe-Post
asked for one-click. None otherwise, so a plain link is never posted to.
Sourcepub fn methods(&self) -> Vec<UnsubscribeMethod>
pub fn methods(&self) -> Vec<UnsubscribeMethod>
The methods on offer, best first: one-click, then mailto, then a link.
Trait Implementations§
Source§impl Clone for Unsubscribe
impl Clone for Unsubscribe
Source§impl Debug for Unsubscribe
impl Debug for Unsubscribe
Source§impl Default for Unsubscribe
impl Default for Unsubscribe
impl Eq for Unsubscribe
Source§impl PartialEq for Unsubscribe
impl PartialEq for Unsubscribe
impl StructuralPartialEq for Unsubscribe
Auto Trait Implementations§
impl Forget for Unsubscribe
impl Freeze for Unsubscribe
impl Move for Unsubscribe
impl RefUnwindSafe for Unsubscribe
impl Send for Unsubscribewhere
RawVecInner: Send,
impl Sync for Unsubscribewhere
RawVecInner: Sync,
impl Unpin for Unsubscribe
impl UnsafeUnpin for Unsubscribewhere
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
PhantomData<String>: UnsafeUnpin,
impl UnwindSafe for Unsubscribewhere
RawVecInner: 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