time/format_description/well_known/
rfc3339.rs

1//! The format described in RFC 3339.
2
3/// The format described in [RFC 3339](https://tools.ietf.org/html/rfc3339#section-5.6).
4///
5/// Format example: 1985-04-12T23:20:50.52Z
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::Rfc3339, OffsetDateTime};
11/// # use time_macros::datetime;
12/// assert_eq!(
13///     OffsetDateTime::parse("1985-04-12T23:20:50.52Z", &Rfc3339)?,
14///     datetime!(1985-04-12 23:20:50.52 +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::Rfc3339;
22/// # use time_macros::datetime;
23/// assert_eq!(
24///     datetime!(1985-04-12 23:20:50.52 +00:00).format(&Rfc3339)?,
25///     "1985-04-12T23:20:50.52Z"
26/// );
27/// # Ok::<_, time::Error>(())
28/// ```
29#[derive(#[automatically_derived]
impl ::core::fmt::Debug for Rfc3339 {
    #[inline]
    fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
        ::core::fmt::Formatter::write_str(f, "Rfc3339")
    }
}Debug, #[automatically_derived]
impl ::core::clone::Clone for Rfc3339 {
    #[inline]
    fn clone(&self) -> Rfc3339 { *self }
}Clone, #[automatically_derived]
impl ::core::marker::Copy for Rfc3339 { }Copy, #[automatically_derived]
impl ::core::cmp::PartialEq for Rfc3339 {
    #[inline]
    fn eq(&self, other: &Rfc3339) -> bool { true }
}PartialEq, #[automatically_derived]
impl ::core::cmp::Eq for Rfc3339 {
    #[inline]
    #[doc(hidden)]
    #[coverage(off)]
    fn assert_receiver_is_total_eq(&self) -> () {}
}Eq)]
30pub struct Rfc3339;