Struct der::GeneralizedTime[][src]

pub struct GeneralizedTime(_);

ASN.1 GeneralizedTime type.

This type implements the validity requirements specified in RFC 5280 Section 4.1.2.5.2, namely:

For the purposes of this profile, GeneralizedTime values MUST be expressed in Greenwich Mean Time (Zulu) and MUST include seconds (i.e., times are YYYYMMDDHHMMSSZ), even where the number of seconds is zero. GeneralizedTime values MUST NOT include fractional seconds.

Implementations

impl GeneralizedTime[src]

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

Create a new GeneralizedTime 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 GeneralizedTime[src]

impl Copy for GeneralizedTime[src]

impl Debug for GeneralizedTime[src]

impl Encodable for GeneralizedTime[src]

impl Eq for GeneralizedTime[src]

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

impl PartialEq<GeneralizedTime> for GeneralizedTime[src]

impl StructuralEq for GeneralizedTime[src]

impl StructuralPartialEq for GeneralizedTime[src]

impl Tagged for GeneralizedTime[src]

impl TryFrom<Any<'_>> for GeneralizedTime[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.