pub struct UtcTime(/* private fields */);
Expand description
ASN.1 UTCTime
type.
This type implements the validity requirements specified in RFC 5280 Section 4.1.2.5.1, namely:
For the purposes of this profile, UTCTime values MUST be expressed in Greenwich Mean Time (Zulu) and MUST include seconds (i.e., times are
YYMMDDHHMMSSZ
), even where the number of seconds is zero. Conforming systems MUST interpret the year field (YY
) as follows:
- Where
YY
is greater than or equal to 50, the year SHALL be interpreted as19YY
; and- Where
YY
is less than 50, the year SHALL be interpreted as20YY
.
Implementations§
source§impl UtcTime
impl UtcTime
sourcepub fn to_date_time(&self) -> DateTime
pub fn to_date_time(&self) -> DateTime
sourcepub fn from_unix_duration(unix_duration: Duration) -> Result<Self>
pub fn from_unix_duration(unix_duration: Duration) -> Result<Self>
sourcepub fn to_unix_duration(&self) -> Duration
pub fn to_unix_duration(&self) -> Duration
Get the duration of this timestamp since UNIX_EPOCH
.
Trait Implementations§
source§impl DecodeValue<'_> for UtcTime
impl DecodeValue<'_> for UtcTime
source§impl EncodeValue for UtcTime
impl EncodeValue for UtcTime
source§impl Ord for UtcTime
impl Ord for UtcTime
source§impl PartialOrd for UtcTime
impl PartialOrd for UtcTime
impl Copy for UtcTime
impl Eq for UtcTime
impl OrdIsValueOrd for UtcTime
impl StructuralPartialEq for UtcTime
Auto Trait Implementations§
impl Freeze for UtcTime
impl RefUnwindSafe for UtcTime
impl Send for UtcTime
impl Sync for UtcTime
impl Unpin for UtcTime
impl UnwindSafe for UtcTime
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§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)source§impl<T> CloneToUninit for Twhere
T: Copy,
impl<T> CloneToUninit for Twhere
T: Copy,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)