Struct der::UtcTime[][src]

pub struct UtcTime(_);

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 as 19YY; and
  • Where YY is less than 50, the year SHALL be interpreted as 20YY.

Implementations

impl UtcTime[src]

pub fn new(unix_duration: Duration) -> Result<Self>[src]

Create a new UtcTime given a Duration since UNIX_EPOCH (a.k.a. "Unix time")

pub fn unix_duration(&self) -> Duration[src]

Get the duration of this timestamp since UNIX_EPOCH.

pub fn from_system_time(time: SystemTime) -> Result<Self>[src]

This is supported on crate feature std only.

Instantiate from SystemTime.

pub fn to_system_time(&self) -> SystemTime[src]

This is supported on crate feature std only.

Convert to SystemTime.

Trait Implementations

impl Clone for UtcTime[src]

impl Copy for UtcTime[src]

impl Debug for UtcTime[src]

impl Encodable for UtcTime[src]

impl Eq for UtcTime[src]

impl From<&'_ UtcTime> for UtcTime[src]

impl PartialEq<UtcTime> for UtcTime[src]

impl StructuralEq for UtcTime[src]

impl StructuralPartialEq for UtcTime[src]

impl Tagged for UtcTime[src]

impl TryFrom<Any<'_>> for UtcTime[src]

type Error = Error

The type returned in the event of a conversion error.

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T[src]

type Output = T

Should always be Self

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.