pub struct ASN1Time(_);
Available on crate feature
mtls
only.Expand description
An ASN.1 timestamp.
Implementations§
§impl ASN1Time
impl ASN1Time
pub const fn to_datetime(&self) -> OffsetDateTime
pub fn from_timestamp(secs: i64) -> ASN1Time
pub fn from_timestamp(secs: i64) -> ASN1Time
Makes a new ASN1Time
from the number of non-leap seconds since Epoch
pub 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”).
pub 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
.
Note: this will fail if year < 1900
Trait Implementations§
§impl From<OffsetDateTime> for ASN1Time
impl From<OffsetDateTime> for ASN1Time
§fn from(dt: OffsetDateTime) -> ASN1Time
fn from(dt: OffsetDateTime) -> ASN1Time
Converts to this type from the input type.
§impl Ord for ASN1Time
impl Ord for ASN1Time
§impl PartialOrd<ASN1Time> for ASN1Time
impl PartialOrd<ASN1Time> for ASN1Time
§fn partial_cmp(&self, other: &ASN1Time) -> Option<Ordering>
fn partial_cmp(&self, other: &ASN1Time) -> Option<Ordering>
1.0.0 · source§fn 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 moreimpl 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§
§impl<'a, T> AsTaggedExplicit<'a> for Twhere
T: 'a,
impl<'a, T> AsTaggedExplicit<'a> for Twhere T: 'a,
§impl<'a, T> AsTaggedImplicit<'a> for Twhere
T: 'a,
impl<'a, T> AsTaggedImplicit<'a> for Twhere T: 'a,
source§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
§impl<T> IntoCollection<T> for T
impl<T> IntoCollection<T> for T
§fn into_collection<A>(self) -> SmallVec<A>where
A: Array<Item = T>,
fn into_collection<A>(self) -> SmallVec<A>where A: Array<Item = T>,
Converts
self
into a collection.