time/format_description/well_known/
rfc2822.rs

1//! The format described in RFC 2822.
2
3/// The format described in [RFC 2822](https://tools.ietf.org/html/rfc2822#section-3.3).
4///
5/// Example: Fri, 21 Nov 1997 09:55:06 -0600
6///
7/// # Examples
8#[cfg_attr(feature = "parsing", doc = "```rust")]
9#[cfg_attr(not(feature = "parsing"), doc = "```rust,ignore")]
10/// # use time::{format_description::well_known::Rfc2822, OffsetDateTime};
11/// use time_macros::datetime;
12/// assert_eq!(
13///     OffsetDateTime::parse("Sat, 12 Jun 1993 13:25:19 GMT", &Rfc2822)?,
14///     datetime!(1993-06-12 13:25:19 +00:00)
15/// );
16/// # Ok::<_, time::Error>(())
17/// ```
18///
19#[cfg_attr(feature = "formatting", doc = "```rust")]
20#[cfg_attr(not(feature = "formatting"), doc = "```rust,ignore")]
21/// # use time::format_description::well_known::Rfc2822;
22/// # use time_macros::datetime;
23/// assert_eq!(
24///     datetime!(1997-11-21 09:55:06 -06:00).format(&Rfc2822)?,
25///     "Fri, 21 Nov 1997 09:55:06 -0600"
26/// );
27/// # Ok::<_, time::Error>(())
28/// ```
29#[derive(#[automatically_derived]
impl ::core::fmt::Debug for Rfc2822 {
    #[inline]
    fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
        ::core::fmt::Formatter::write_str(f, "Rfc2822")
    }
}Debug, #[automatically_derived]
impl ::core::clone::Clone for Rfc2822 {
    #[inline]
    fn clone(&self) -> Rfc2822 { *self }
}Clone, #[automatically_derived]
impl ::core::marker::Copy for Rfc2822 { }Copy, #[automatically_derived]
impl ::core::cmp::PartialEq for Rfc2822 {
    #[inline]
    fn eq(&self, other: &Rfc2822) -> bool { true }
}PartialEq, #[automatically_derived]
impl ::core::cmp::Eq for Rfc2822 {
    #[inline]
    #[doc(hidden)]
    #[coverage(off)]
    fn assert_receiver_is_total_eq(&self) -> () {}
}Eq)]
30pub struct Rfc2822;