pub struct UtcDateTime { /* private fields */ }
Expand description
Date time with UTC timezone
Implementations§
Source§impl UtcDateTime
impl UtcDateTime
Sourcepub fn from_rfc3339(value: &str) -> Result<Self, UtcDateTimeError>
pub fn from_rfc3339(value: &str) -> Result<Self, UtcDateTimeError>
Create a new date time from RFC3339 string
§Example
use api_tools::value_objects::datetime::UtcDateTime;
let datetime = UtcDateTime::from_rfc3339("2024-08-28T12:00:00Z");
assert_eq!(datetime.unwrap().to_string(), "2024-08-28T12:00:00Z".to_owned());
let invalid_datetime = UtcDateTime::from_rfc3339("2024-08-T12:00:00Z");
Trait Implementations§
Source§impl Clone for UtcDateTime
impl Clone for UtcDateTime
Source§fn clone(&self) -> UtcDateTime
fn clone(&self) -> UtcDateTime
Returns a duplicate 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 UtcDateTime
impl Debug for UtcDateTime
Source§impl Default for UtcDateTime
impl Default for UtcDateTime
Source§fn default() -> UtcDateTime
fn default() -> UtcDateTime
Returns the “default value” for a type. Read more
Source§impl Display for UtcDateTime
impl Display for UtcDateTime
Source§impl PartialEq for UtcDateTime
impl PartialEq for UtcDateTime
Source§impl PartialOrd for UtcDateTime
impl PartialOrd for UtcDateTime
impl Eq for UtcDateTime
impl StructuralPartialEq for UtcDateTime
Auto Trait Implementations§
impl Freeze for UtcDateTime
impl RefUnwindSafe for UtcDateTime
impl Send for UtcDateTime
impl Sync for UtcDateTime
impl Unpin for UtcDateTime
impl UnwindSafe for UtcDateTime
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> 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.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> ServiceExt for T
impl<T> ServiceExt for T
Source§fn set_request_id<M>(
self,
header_name: HeaderName,
make_request_id: M,
) -> SetRequestId<Self, M>where
Self: Sized,
M: MakeRequestId,
fn set_request_id<M>(
self,
header_name: HeaderName,
make_request_id: M,
) -> SetRequestId<Self, M>where
Self: Sized,
M: MakeRequestId,
Add request id header and extension. Read more
Source§fn set_x_request_id<M>(self, make_request_id: M) -> SetRequestId<Self, M>where
Self: Sized,
M: MakeRequestId,
fn set_x_request_id<M>(self, make_request_id: M) -> SetRequestId<Self, M>where
Self: Sized,
M: MakeRequestId,
Add request id header and extension, using
x-request-id
as the header name. Read moreSource§fn propagate_request_id(
self,
header_name: HeaderName,
) -> PropagateRequestId<Self>where
Self: Sized,
fn propagate_request_id(
self,
header_name: HeaderName,
) -> PropagateRequestId<Self>where
Self: Sized,
Propgate request ids from requests to responses. Read more
Source§fn propagate_x_request_id(self) -> PropagateRequestId<Self>where
Self: Sized,
fn propagate_x_request_id(self) -> PropagateRequestId<Self>where
Self: Sized,
Propgate request ids from requests to responses, using
x-request-id
as the header name. Read more