Struct der::GeneralizedTime [−][src]
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]
fn clone(&self) -> GeneralizedTime
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Copy for GeneralizedTime
[src]
impl Debug for GeneralizedTime
[src]
impl Encodable for GeneralizedTime
[src]
fn encoded_len(&self) -> Result<Length>
[src]
fn encode(&self, encoder: &mut Encoder<'_>) -> Result<()>
[src]
fn encode_to_slice<'a>(&self, buf: &'a mut [u8]) -> Result<&'a [u8]>
[src]
fn encode_to_vec(&self, buf: &mut Vec<u8>) -> Result<Length>
[src]
fn to_vec(&self) -> Result<Vec<u8>>
[src]
impl Eq for GeneralizedTime
[src]
impl From<&'_ GeneralizedTime> for GeneralizedTime
[src]
fn from(value: &GeneralizedTime) -> GeneralizedTime
[src]
impl PartialEq<GeneralizedTime> for GeneralizedTime
[src]
fn eq(&self, other: &GeneralizedTime) -> bool
[src]
fn ne(&self, other: &GeneralizedTime) -> bool
[src]
impl StructuralEq for GeneralizedTime
[src]
impl StructuralPartialEq for GeneralizedTime
[src]
impl Tagged for GeneralizedTime
[src]
impl TryFrom<Any<'_>> for GeneralizedTime
[src]
Auto Trait Implementations
impl RefUnwindSafe for GeneralizedTime
[src]
impl Send for GeneralizedTime
[src]
impl Sync for GeneralizedTime
[src]
impl Unpin for GeneralizedTime
[src]
impl UnwindSafe for GeneralizedTime
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Same<T> for T
[src]
type Output = T
Should always be Self
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,