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 const fn length() -> Length
[src]
Length of an RFC 5280-flavored ASN.1 DER-encoded GeneralizedTime
.
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]
std
only.Instantiate from SystemTime
.
pub fn to_system_time(&self) -> SystemTime
[src]
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 Ord for GeneralizedTime
[src]
fn cmp(&self, other: &GeneralizedTime) -> Ordering
[src]
#[must_use]pub fn max(self, other: Self) -> Self
1.21.0[src]
#[must_use]pub fn min(self, other: Self) -> Self
1.21.0[src]
#[must_use]pub fn clamp(self, min: Self, max: Self) -> Self
1.50.0[src]
impl PartialEq<GeneralizedTime> for GeneralizedTime
[src]
fn eq(&self, other: &GeneralizedTime) -> bool
[src]
fn ne(&self, other: &GeneralizedTime) -> bool
[src]
impl PartialOrd<GeneralizedTime> for GeneralizedTime
[src]
fn partial_cmp(&self, other: &GeneralizedTime) -> Option<Ordering>
[src]
#[must_use]pub fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn ge(&self, other: &Rhs) -> bool
1.0.0[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
impl Send for GeneralizedTime
impl Sync for GeneralizedTime
impl Unpin for GeneralizedTime
impl UnwindSafe for GeneralizedTime
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>,