Struct x509_parser::time::ASN1Time
source · [−]pub struct ASN1Time(_);Expand description
An ASN.1 timestamp.
Implementations
sourceimpl ASN1Time
impl ASN1Time
pub const fn to_datetime(&self) -> OffsetDateTime
sourcepub fn from_timestamp(secs: i64) -> Self
pub fn from_timestamp(secs: i64) -> Self
Makes a new ASN1Time from the number of non-leap seconds since Epoch
sourcepub fn timestamp(&self) -> i64
pub fn timestamp(&self) -> i64
Returns the number of non-leap seconds since January 1, 1970 0:00:00 UTC (aka “UNIX timestamp”).
sourcepub fn to_rfc2822(self) -> String
pub fn to_rfc2822(self) -> String
Returns an RFC 2822 date and time string such as Tue, 1 Jul 2003 10:52:37 +0200.
Trait Implementations
sourceimpl From<OffsetDateTime> for ASN1Time
impl From<OffsetDateTime> for ASN1Time
sourcefn from(dt: OffsetDateTime) -> Self
fn from(dt: OffsetDateTime) -> Self
Performs the conversion.
sourceimpl Ord for ASN1Time
impl Ord for ASN1Time
sourceimpl PartialOrd<ASN1Time> for ASN1Time
impl PartialOrd<ASN1Time> for ASN1Time
sourcefn partial_cmp(&self, other: &ASN1Time) -> Option<Ordering>
fn partial_cmp(&self, other: &ASN1Time) -> Option<Ordering>
This method returns an ordering between self and other values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for self and other) and is used by the <=
operator. Read more
impl Copy for ASN1Time
impl Eq for ASN1Time
impl StructuralEq for ASN1Time
impl StructuralPartialEq for ASN1Time
Auto Trait Implementations
impl RefUnwindSafe for ASN1Time
impl Send for ASN1Time
impl Sync for ASN1Time
impl Unpin for ASN1Time
impl UnwindSafe for ASN1Time
Blanket Implementations
sourceimpl<'a, T> AsTaggedExplicit<'a> for T where
T: 'a,
impl<'a, T> AsTaggedExplicit<'a> for T where
T: 'a,
sourceimpl<'a, T> AsTaggedImplicit<'a> for T where
T: 'a,
impl<'a, T> AsTaggedImplicit<'a> for T where
T: 'a,
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
toowned_clone_into)Uses borrowed data to replace owned data, usually by cloning. Read more