pub struct HeaderName { /* private fields */ }
Expand description
Case insensitive owned wrapper for a header name.
As of RFC5322
it’s guaranteed to be ASCII.
Implementations§
source§impl HeaderName
impl HeaderName
sourcepub fn as_str(&self) -> &str
pub fn as_str(&self) -> &str
Returns a str
representation of the header.
The returned string will always be lower case. Use Display
for a
properly formatted representation.
sourcepub fn as_lowercase_bytes(&self) -> &[u8] ⓘ
pub fn as_lowercase_bytes(&self) -> &[u8] ⓘ
Returns a &[u8]
representation of the header.
The returned string will always be lower case. Use Display
for a
properly formatted representation.
sourcepub fn into_bytes(self) -> Vec<u8>
pub fn into_bytes(self) -> Vec<u8>
Converts a header into a Vec<u8>
.
The returned string will always be formatted.
pub fn from_bytes(src: &[u8]) -> Result<Self, InvalidHeaderName>
pub const fn is_standard(&self) -> bool
source§impl HeaderName
impl HeaderName
pub const SUBJECT: Self = SUBJECT
pub const REPLY_TO: Self = REPLY_TO
pub const IN_REPLY_TO: Self = IN_REPLY_TO
pub const REFERENCES: Self = REFERENCES
pub const MAIL_REPLY_TO: Self = MAIL_REPLY_TO
pub const MAIL_FOLLOWUP_TO: Self = MAIL_FOLLOWUP_TO
pub const DELIVERED_TO: Self = DELIVERED_TO
pub const COMMENTS: Self = COMMENTS
pub const KEYWORDS: Self = KEYWORDS
pub const RECEIVED: Self = RECEIVED
pub const CONTENT_LANGUAGE: Self = CONTENT_LANGUAGE
pub const CONTENT_LENGTH: Self = CONTENT_LENGTH
pub const FORWARDED: Self = FORWARDED
pub const ACCEPT_LANGUAGE: Self = ACCEPT_LANGUAGE
pub const ALSO_CONTROL: Self = ALSO_CONTROL
pub const ALTERNATE_RECIPIENT: Self = ALTERNATE_RECIPIENT
pub const APPROVED: Self = APPROVED
pub const ARC_AUTHENTICATION_RESULTS: Self = ARC_AUTHENTICATION_RESULTS
pub const ARC_MESSAGE_SIGNATURE: Self = ARC_MESSAGE_SIGNATURE
pub const ARC_SEAL: Self = ARC_SEAL
pub const ARCHIVE: Self = ARCHIVE
pub const ARCHIVED_AT: Self = ARCHIVED_AT
pub const ARTICLE_NAMES: Self = ARTICLE_NAMES
pub const ARTICLE_UPDATES: Self = ARTICLE_UPDATES
pub const AUTHENTICATION_RESULTS: Self = AUTHENTICATION_RESULTS
pub const AUTO_SUBMITTED: Self = AUTO_SUBMITTED
pub const AUTOFORWARDED: Self = AUTOFORWARDED
pub const AUTOSUBMITTED: Self = AUTOSUBMITTED
pub const BASE: Self = BASE
pub const BCC: Self = BCC
pub const BODY: Self = BODY
pub const CANCEL_KEY: Self = CANCEL_KEY
pub const CANCEL_LOCK: Self = CANCEL_LOCK
pub const CC: Self = CC
pub const CONTENT_ALTERNATIVE: Self = CONTENT_ALTERNATIVE
pub const CONTENT_BASE: Self = CONTENT_BASE
pub const CONTENT_DESCRIPTION: Self = CONTENT_DESCRIPTION
pub const CONTENT_DISPOSITION: Self = CONTENT_DISPOSITION
pub const CONTENT_DURATION: Self = CONTENT_DURATION
pub const CONTENT_FEATURES: Self = CONTENT_FEATURES
pub const CONTENT_ID: Self = CONTENT_ID
pub const CONTENT_IDENTIFIER: Self = CONTENT_IDENTIFIER
pub const CONTENT_LOCATION: Self = CONTENT_LOCATION
pub const CONTENT_MD5: Self = CONTENT_MD5
pub const CONTENT_RETURN: Self = CONTENT_RETURN
pub const CONTENT_TRANSFER_ENCODING: Self = CONTENT_TRANSFER_ENCODING
pub const CONTENT_TRANSLATION_TYPE: Self = CONTENT_TRANSLATION_TYPE
pub const CONTENT_TYPE: Self = CONTENT_TYPE
pub const CONTROL: Self = CONTROL
pub const CONVERSION: Self = CONVERSION
pub const CONVERSION_WITH_LOSS: Self = CONVERSION_WITH_LOSS
pub const DL_EXPANSION_HISTORY: Self = DL_EXPANSION_HISTORY
pub const DATE: Self = DATE
pub const DATE_RECEIVED: Self = DATE_RECEIVED
pub const DEFERRED_DELIVERY: Self = DEFERRED_DELIVERY
pub const DELIVERY_DATE: Self = DELIVERY_DATE
pub const DISCARDED_X400_IPMS_EXTENSIONS: Self = DISCARDED_X400_IPMS_EXTENSIONS
pub const DISCARDED_X400_MTS_EXTENSIONS: Self = DISCARDED_X400_MTS_EXTENSIONS
pub const DISCLOSE_RECIPIENTS: Self = DISCLOSE_RECIPIENTS
pub const DISPOSITION_NOTIFICATION_OPTIONS: Self = DISPOSITION_NOTIFICATION_OPTIONS
pub const DISPOSITION_NOTIFICATION_TO: Self = DISPOSITION_NOTIFICATION_TO
pub const DISTRIBUTION: Self = DISTRIBUTION
pub const DKIM_SIGNATURE: Self = DKIM_SIGNATURE
pub const DOWNGRADED_BCC: Self = DOWNGRADED_BCC
pub const DOWNGRADED_CC: Self = DOWNGRADED_CC
pub const DOWNGRADED_DISPOSITION_NOTIFICATION_TO: Self = DOWNGRADED_DISPOSITION_NOTIFICATION_TO
pub const DOWNGRADED_FINAL_RECIPIENT: Self = DOWNGRADED_FINAL_RECIPIENT
pub const DOWNGRADED_FROM: Self = DOWNGRADED_FROM
pub const DOWNGRADED_IN_REPLY_TO: Self = DOWNGRADED_IN_REPLY_TO
pub const DOWNGRADED_MAIL_FROM: Self = DOWNGRADED_MAIL_FROM
pub const DOWNGRADED_MESSAGE_ID: Self = DOWNGRADED_MESSAGE_ID
pub const DOWNGRADED_ORIGINAL_RECIPIENT: Self = DOWNGRADED_ORIGINAL_RECIPIENT
pub const DOWNGRADED_RCPT_TO: Self = DOWNGRADED_RCPT_TO
pub const DOWNGRADED_REFERENCES: Self = DOWNGRADED_REFERENCES
pub const DOWNGRADED_REPLY_TO: Self = DOWNGRADED_REPLY_TO
pub const DOWNGRADED_RESENT_BCC: Self = DOWNGRADED_RESENT_BCC
pub const DOWNGRADED_RESENT_CC: Self = DOWNGRADED_RESENT_CC
pub const DOWNGRADED_RESENT_FROM: Self = DOWNGRADED_RESENT_FROM
pub const DOWNGRADED_RESENT_REPLY_TO: Self = DOWNGRADED_RESENT_REPLY_TO
pub const DOWNGRADED_RESENT_SENDER: Self = DOWNGRADED_RESENT_SENDER
pub const DOWNGRADED_RESENT_TO: Self = DOWNGRADED_RESENT_TO
pub const DOWNGRADED_RETURN_PATH: Self = DOWNGRADED_RETURN_PATH
pub const DOWNGRADED_SENDER: Self = DOWNGRADED_SENDER
pub const DOWNGRADED_TO: Self = DOWNGRADED_TO
pub const ENCODING: Self = ENCODING
pub const ENCRYPTED: Self = ENCRYPTED
pub const EXPIRES: Self = EXPIRES
pub const EXPIRY_DATE: Self = EXPIRY_DATE
pub const FOLLOWUP_TO: Self = FOLLOWUP_TO
pub const FROM: Self = FROM
pub const GENERATE_DELIVERY_REPORT: Self = GENERATE_DELIVERY_REPORT
pub const IMPORTANCE: Self = IMPORTANCE
pub const INCOMPLETE_COPY: Self = INCOMPLETE_COPY
pub const INJECTION_DATE: Self = INJECTION_DATE
pub const INJECTION_INFO: Self = INJECTION_INFO
pub const LANGUAGE: Self = LANGUAGE
pub const LATEST_DELIVERY_TIME: Self = LATEST_DELIVERY_TIME
pub const LINES: Self = LINES
pub const LIST_ARCHIVE: Self = LIST_ARCHIVE
pub const LIST_HELP: Self = LIST_HELP
pub const LIST_ID: Self = LIST_ID
pub const LIST_OWNER: Self = LIST_OWNER
pub const LIST_POST: Self = LIST_POST
pub const LIST_SUBSCRIBE: Self = LIST_SUBSCRIBE
pub const LIST_UNSUBSCRIBE: Self = LIST_UNSUBSCRIBE
pub const LIST_UNSUBSCRIBE_POST: Self = LIST_UNSUBSCRIBE_POST
pub const MESSAGE_CONTEXT: Self = MESSAGE_CONTEXT
pub const MESSAGE_ID: Self = MESSAGE_ID
pub const MESSAGE_TYPE: Self = MESSAGE_TYPE
pub const MIME_VERSION: Self = MIME_VERSION
pub const MT_PRIORITY: Self = MT_PRIORITY
pub const NEWSGROUPS: Self = NEWSGROUPS
pub const NNTP_POSTING_DATE: Self = NNTP_POSTING_DATE
pub const NNTP_POSTING_HOST: Self = NNTP_POSTING_HOST
pub const OBSOLETES: Self = OBSOLETES
pub const ORGANIZATION: Self = ORGANIZATION
pub const ORIGINAL_ENCODED_INFORMATION_TYPES: Self = ORIGINAL_ENCODED_INFORMATION_TYPES
pub const ORIGINAL_FROM: Self = ORIGINAL_FROM
pub const ORIGINAL_MESSAGE_ID: Self = ORIGINAL_MESSAGE_ID
pub const ORIGINAL_RECIPIENT: Self = ORIGINAL_RECIPIENT
pub const ORIGINAL_SENDER: Self = ORIGINAL_SENDER
pub const ORIGINATOR_RETURN_ADDRESS: Self = ORIGINATOR_RETURN_ADDRESS
pub const ORIGINAL_SUBJECT: Self = ORIGINAL_SUBJECT
pub const PATH: Self = PATH
pub const PICS_LABEL: Self = PICS_LABEL
pub const POSTING_VERSION: Self = POSTING_VERSION
pub const PREVENT_NONDELIVERY_REPORT: Self = PREVENT_NONDELIVERY_REPORT
pub const PRIORITY: Self = PRIORITY
pub const RECEIVED_SPF: Self = RECEIVED_SPF
pub const RELAY_VERSION: Self = RELAY_VERSION
pub const REPLY_BY: Self = REPLY_BY
pub const REQUIRE_RECIPIENT_VALID_SINCE: Self = REQUIRE_RECIPIENT_VALID_SINCE
pub const RESENT_BCC: Self = RESENT_BCC
pub const RESENT_CC: Self = RESENT_CC
pub const RESENT_DATE: Self = RESENT_DATE
pub const RESENT_FROM: Self = RESENT_FROM
pub const RESENT_MESSAGE_ID: Self = RESENT_MESSAGE_ID
pub const RESENT_REPLY_TO: Self = RESENT_REPLY_TO
pub const RESENT_SENDER: Self = RESENT_SENDER
pub const RESENT_TO: Self = RESENT_TO
pub const RETURN_PATH: Self = RETURN_PATH
pub const SEE_ALSO: Self = SEE_ALSO
pub const SENDER: Self = SENDER
pub const SENSITIVITY: Self = SENSITIVITY
pub const SOLICITATION: Self = SOLICITATION
pub const STATUS: Self = STATUS
pub const SUMMARY: Self = SUMMARY
pub const SUPERSEDES: Self = SUPERSEDES
pub const TLS_REPORT_DOMAIN: Self = TLS_REPORT_DOMAIN
pub const TLS_REPORT_SUBMITTER: Self = TLS_REPORT_SUBMITTER
pub const TLS_REQUIRED: Self = TLS_REQUIRED
pub const TO: Self = TO
pub const USER_AGENT: Self = USER_AGENT
pub const VBR_INFO: Self = VBR_INFO
pub const X400_CONTENT_IDENTIFIER: Self = X400_CONTENT_IDENTIFIER
pub const X400_CONTENT_RETURN: Self = X400_CONTENT_RETURN
pub const X400_CONTENT_TYPE: Self = X400_CONTENT_TYPE
pub const X400_MTS_IDENTIFIER: Self = X400_MTS_IDENTIFIER
pub const X400_ORIGINATOR: Self = X400_ORIGINATOR
pub const X400_RECEIVED: Self = X400_RECEIVED
pub const X400_RECIPIENTS: Self = X400_RECIPIENTS
pub const X400_TRACE: Self = X400_TRACE
pub const XREF: Self = XREF
pub const APPARENTLY_TO: Self = APPARENTLY_TO
pub const AUTHOR: Self = AUTHOR
pub const EDIINT_FEATURES: Self = EDIINT_FEATURES
pub const EESST_VERSION: Self = EESST_VERSION
pub const ERRORS_TO: Self = ERRORS_TO
pub const JABBER_ID: Self = JABBER_ID
pub const SIO_LABEL: Self = SIO_LABEL
pub const SIO_LABEL_HISTORY: Self = SIO_LABEL_HISTORY
pub const X_ARCHIVED_AT: Self = X_ARCHIVED_AT
pub const X_KEYWORDS: Self = X_KEYWORDS
pub const X_MITTENTE: Self = X_MITTENTE
pub const X_RICEVUTA: Self = X_RICEVUTA
pub const X_RIFERIMENTO_MESSAGE_ID: Self = X_RIFERIMENTO_MESSAGE_ID
pub const X_STATUS: Self = X_STATUS
pub const X_TIPORICEVUTA: Self = X_TIPORICEVUTA
pub const X_TRASPORTO: Self = X_TRASPORTO
pub const X_VERIFICASICUREZZA: Self = X_VERIFICASICUREZZA
Trait Implementations§
source§impl AsRef<[u8]> for HeaderName
impl AsRef<[u8]> for HeaderName
source§impl AsRef<str> for HeaderName
impl AsRef<str> for HeaderName
source§impl Borrow<str> for HeaderName
impl Borrow<str> for HeaderName
source§impl Clone for HeaderName
impl Clone for HeaderName
source§fn clone(&self) -> HeaderName
fn clone(&self) -> HeaderName
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for HeaderName
impl Debug for HeaderName
source§impl<'de> Deserialize<'de> for HeaderName
impl<'de> Deserialize<'de> for HeaderName
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
source§impl Display for HeaderName
impl Display for HeaderName
source§impl From<&HeaderName> for Cow<'static, str>
impl From<&HeaderName> for Cow<'static, str>
source§fn from(src: &HeaderName) -> Self
fn from(src: &HeaderName) -> Self
Converts to this type from the input type.
source§impl<'a> From<&'a HeaderName> for HeaderName
impl<'a> From<&'a HeaderName> for HeaderName
source§impl FromStr for HeaderName
impl FromStr for HeaderName
§type Err = InvalidHeaderName
type Err = InvalidHeaderName
The associated error which can be returned from parsing.
source§impl Hash for HeaderName
impl Hash for HeaderName
source§impl Index<&HeaderName> for HeaderMap
impl Index<&HeaderName> for HeaderMap
source§impl Index<HeaderName> for HeaderMap
impl Index<HeaderName> for HeaderMap
source§impl<'a> PartialEq<&'a HeaderName> for HeaderName
impl<'a> PartialEq<&'a HeaderName> for HeaderName
source§impl<'a> PartialEq<&'a str> for HeaderName
impl<'a> PartialEq<&'a str> for HeaderName
source§impl<'a> PartialEq<HeaderName> for &'a HeaderName
impl<'a> PartialEq<HeaderName> for &'a HeaderName
source§fn eq(&self, other: &HeaderName) -> bool
fn eq(&self, other: &HeaderName) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl<'a> PartialEq<HeaderName> for &'a str
impl<'a> PartialEq<HeaderName> for &'a str
source§fn eq(&self, other: &HeaderName) -> bool
fn eq(&self, other: &HeaderName) -> bool
Performs a case-insensitive comparison of the string against the header name
source§impl PartialEq<HeaderName> for str
impl PartialEq<HeaderName> for str
source§fn eq(&self, other: &HeaderName) -> bool
fn eq(&self, other: &HeaderName) -> bool
Performs a case-insensitive comparison of the string against the header name
§Examples
use std::convert::TryFrom;
use melib::email::headers::HeaderName;
assert_eq!(HeaderName::CONTENT_LENGTH, "content-length");
assert_eq!(HeaderName::CONTENT_LENGTH, "Content-Length");
assert_ne!(HeaderName::CONTENT_LENGTH, "content length");
assert_eq!(
HeaderName::CONTENT_LENGTH,
HeaderName::try_from("content-length").unwrap()
);
source§impl PartialEq<str> for HeaderName
impl PartialEq<str> for HeaderName
source§fn eq(&self, other: &str) -> bool
fn eq(&self, other: &str) -> bool
Performs a case-insensitive comparison of the string against the header name
§Examples
use melib::email::headers::HeaderName;
assert_eq!(HeaderName::CONTENT_LENGTH, "content-length");
assert_eq!(HeaderName::CONTENT_LENGTH, "Content-Length");
assert_ne!(HeaderName::CONTENT_LENGTH, "content length");
source§impl PartialEq for HeaderName
impl PartialEq for HeaderName
source§fn eq(&self, other: &HeaderName) -> bool
fn eq(&self, other: &HeaderName) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl Serialize for HeaderName
impl Serialize for HeaderName
source§impl<'a> TryFrom<&'a [u8]> for HeaderName
impl<'a> TryFrom<&'a [u8]> for HeaderName
source§impl<'a> TryFrom<&'a String> for HeaderName
impl<'a> TryFrom<&'a String> for HeaderName
source§impl<'a> TryFrom<&'a str> for HeaderName
impl<'a> TryFrom<&'a str> for HeaderName
source§impl TryFrom<String> for HeaderName
impl TryFrom<String> for HeaderName
impl Eq for HeaderName
impl StructuralPartialEq for HeaderName
Auto Trait Implementations§
impl Freeze for HeaderName
impl RefUnwindSafe for HeaderName
impl Send for HeaderName
impl Sync for HeaderName
impl Unpin for HeaderName
impl UnwindSafe for HeaderName
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.