Struct der::UtcTime [−][src]
pub struct UtcTime(_);
Expand description
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
YYis greater than or equal to 50, the year SHALL be interpreted as19YY; and- Where
YYis less than 50, the year SHALL be interpreted as20YY.
Implementations
impl UtcTime[src]
impl UtcTime[src]pub const fn length() -> Length[src]
👎 Deprecated since 0.3.3: please use UtcTime::LENGTH
pub const fn length() -> Length[src]please use UtcTime::LENGTH
Length of an RFC 5280-flavored ASN.1 DER-encoded UtcTime.
pub fn unix_duration(&self) -> Duration[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.
pub fn from_system_time(time: SystemTime) -> Result<Self>[src]std only.Instantiate from SystemTime.
pub fn to_system_time(&self) -> SystemTime[src]
This is supported on crate feature std only.
pub fn to_system_time(&self) -> SystemTime[src]std only.Convert to SystemTime.
Trait Implementations
impl Encodable for UtcTime[src]
impl Encodable for UtcTime[src]fn encoded_len(&self) -> Result<Length>[src]
fn encoded_len(&self) -> Result<Length>[src]Compute the length of this value in bytes when encoded as ASN.1 DER.
fn encode(&self, encoder: &mut Encoder<'_>) -> Result<()>[src]
fn encode(&self, encoder: &mut Encoder<'_>) -> Result<()>[src]Encode this value as ASN.1 DER using the provided Encoder.
fn encode_to_slice<'a>(&self, buf: &'a mut [u8]) -> Result<&'a [u8]>[src]
fn encode_to_slice<'a>(&self, buf: &'a mut [u8]) -> Result<&'a [u8]>[src]Encode this value to the provided byte slice, returning a sub-slice containing the encoded message. Read more
impl Ord for UtcTime[src]
impl Ord for UtcTime[src]impl PartialOrd<UtcTime> for UtcTime[src]
impl PartialOrd<UtcTime> for UtcTime[src]fn partial_cmp(&self, other: &UtcTime) -> Option<Ordering>[src]
fn partial_cmp(&self, other: &UtcTime) -> Option<Ordering>[src]This method returns an ordering between self and other values if one exists. Read more
#[must_use]fn lt(&self, other: &Rhs) -> bool1.0.0[src]
#[must_use]fn lt(&self, other: &Rhs) -> bool1.0.0[src]This method tests less than (for self and other) and is used by the < operator. Read more
#[must_use]fn le(&self, other: &Rhs) -> bool1.0.0[src]
#[must_use]fn le(&self, other: &Rhs) -> bool1.0.0[src]This method tests less than or equal to (for self and other) and is used by the <=
operator. Read more
impl Copy for UtcTime[src]
impl Eq for UtcTime[src]
impl StructuralEq for UtcTime[src]
impl StructuralPartialEq for UtcTime[src]
Auto Trait Implementations
impl RefUnwindSafe for UtcTime
impl Send for UtcTime
impl Sync for UtcTime
impl Unpin for UtcTime
impl UnwindSafe for UtcTime
Blanket Implementations
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]pub fn borrow_mut(&mut self) -> &mut T[src]
pub fn borrow_mut(&mut self) -> &mut T[src]Mutably borrows from an owned value. Read more
impl<T> ToOwned for T where
T: Clone, [src]
impl<T> ToOwned for T where
T: Clone, [src]type Owned = T
type Owned = TThe resulting type after obtaining ownership.
pub fn to_owned(&self) -> T[src]
pub fn to_owned(&self) -> T[src]Creates owned data from borrowed data, usually by cloning. Read more
pub fn clone_into(&self, target: &mut T)[src]
pub fn clone_into(&self, target: &mut T)[src]🔬 This is a nightly-only experimental API. (toowned_clone_into)
recently added
Uses borrowed data to replace owned data, usually by cloning. Read more