pub struct Rfc3339DateTime(pub OffsetDateTime);Expand description
An API timestamp with one JSON and OpenAPI representation: an RFC 3339
string with OpenAPI date-time format.
Use this at DTO boundaries around a domain time::OffsetDateTime. The
wrapper prevents time’s default non-human-readable nine-element tuple from
leaking into JSON while keeping conversion to and from the domain type
explicit and lossless.
Tuple Fields§
§0: OffsetDateTimeImplementations§
Source§impl Rfc3339DateTime
impl Rfc3339DateTime
Sourcepub const fn new(value: OffsetDateTime) -> Rfc3339DateTime
pub const fn new(value: OffsetDateTime) -> Rfc3339DateTime
Wraps a domain timestamp for use in an API DTO.
Sourcepub const fn into_inner(self) -> OffsetDateTime
pub const fn into_inner(self) -> OffsetDateTime
Returns the wrapped domain timestamp.
Trait Implementations§
Source§impl Clone for Rfc3339DateTime
impl Clone for Rfc3339DateTime
Source§fn clone(&self) -> Rfc3339DateTime
fn clone(&self) -> Rfc3339DateTime
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for Rfc3339DateTime
Source§impl Debug for Rfc3339DateTime
impl Debug for Rfc3339DateTime
Source§impl<'de> Deserialize<'de> for Rfc3339DateTime
impl<'de> Deserialize<'de> for Rfc3339DateTime
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<Rfc3339DateTime, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<Rfc3339DateTime, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Display for Rfc3339DateTime
impl Display for Rfc3339DateTime
impl Eq for Rfc3339DateTime
Source§impl From<OffsetDateTime> for Rfc3339DateTime
impl From<OffsetDateTime> for Rfc3339DateTime
Source§fn from(value: OffsetDateTime) -> Rfc3339DateTime
fn from(value: OffsetDateTime) -> Rfc3339DateTime
Converts to this type from the input type.
Source§impl FromStr for Rfc3339DateTime
impl FromStr for Rfc3339DateTime
Source§impl Hash for Rfc3339DateTime
impl Hash for Rfc3339DateTime
Source§impl Ord for Rfc3339DateTime
impl Ord for Rfc3339DateTime
Source§fn cmp(&self, other: &Rfc3339DateTime) -> Ordering
fn cmp(&self, other: &Rfc3339DateTime) -> Ordering
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the minimum of two values. Read more
Source§impl PartialEq for Rfc3339DateTime
impl PartialEq for Rfc3339DateTime
Source§impl PartialOrd for Rfc3339DateTime
impl PartialOrd for Rfc3339DateTime
Source§impl Serialize for Rfc3339DateTime
impl Serialize for Rfc3339DateTime
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl StructuralPartialEq for Rfc3339DateTime
Auto Trait Implementations§
impl Freeze for Rfc3339DateTime
impl RefUnwindSafe for Rfc3339DateTime
impl Send for Rfc3339DateTime
impl Sync for Rfc3339DateTime
impl Unpin for Rfc3339DateTime
impl UnsafeUnpin for Rfc3339DateTime
impl UnwindSafe for Rfc3339DateTime
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<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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.