Struct der::UtcTime [−][src]
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
impl UtcTime
[src]
pub fn new(unix_duration: Duration) -> Result<Self>
[src]
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]
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 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]
Auto Trait Implementations
impl RefUnwindSafe for UtcTime
[src]
impl Send for UtcTime
[src]
impl Sync for UtcTime
[src]
impl Unpin for UtcTime
[src]
impl UnwindSafe for UtcTime
[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>,