Struct Asn1Time
pub struct Asn1Time(/* private fields */);
Expand description
Time storage and comparison
Asn1Time should be used to store and share time information using certificates. If Asn1Time is set using a string, it must be in either YYMMDDHHMMSSZ, YYYYMMDDHHMMSSZ, or another ASN.1 format.
ASN_TIME_set documentation at OpenSSL explains the ASN.1 implementation used by OpenSSL.
Implementations§
§impl Asn1Time
impl Asn1Time
pub fn days_from_now(days: u32) -> Result<Asn1Time, ErrorStack>
pub fn days_from_now(days: u32) -> Result<Asn1Time, ErrorStack>
Creates a new time on specified interval in days from now
pub fn from_unix(time: i64) -> Result<Asn1Time, ErrorStack>
pub fn from_unix(time: i64) -> Result<Asn1Time, ErrorStack>
Creates a new time from the specified time_t
value
This corresponds to ASN1_TIME_set
.
pub fn from_str(s: &str) -> Result<Asn1Time, ErrorStack>
pub fn from_str(s: &str) -> Result<Asn1Time, ErrorStack>
Creates a new time corresponding to the specified ASN1 time string.
This corresponds to ASN1_TIME_set_string
.
Methods from Deref<Target = Asn1TimeRef>§
pub fn diff(&self, compare: &Asn1TimeRef) -> Result<TimeDiff, ErrorStack>
pub fn diff(&self, compare: &Asn1TimeRef) -> Result<TimeDiff, ErrorStack>
Find difference between two times
This corresponds to ASN1_TIME_diff
.
pub fn compare(&self, other: &Asn1TimeRef) -> Result<Ordering, ErrorStack>
pub fn compare(&self, other: &Asn1TimeRef) -> Result<Ordering, ErrorStack>
Compare two times
This corresponds to ASN1_TIME_compare
.
Trait Implementations§
§impl AsMut<Asn1TimeRef> for Asn1Time
impl AsMut<Asn1TimeRef> for Asn1Time
§fn as_mut(&mut self) -> &mut Asn1TimeRef
fn as_mut(&mut self) -> &mut Asn1TimeRef
Converts this type into a mutable reference of the (usually inferred) input type.
§impl AsRef<Asn1TimeRef> for Asn1Time
impl AsRef<Asn1TimeRef> for Asn1Time
§fn as_ref(&self) -> &Asn1TimeRef
fn as_ref(&self) -> &Asn1TimeRef
Converts this type into a shared reference of the (usually inferred) input type.
§impl Borrow<Asn1TimeRef> for Asn1Time
impl Borrow<Asn1TimeRef> for Asn1Time
§fn borrow(&self) -> &Asn1TimeRef
fn borrow(&self) -> &Asn1TimeRef
Immutably borrows from an owned value. Read more
§impl BorrowMut<Asn1TimeRef> for Asn1Time
impl BorrowMut<Asn1TimeRef> for Asn1Time
§fn borrow_mut(&mut self) -> &mut Asn1TimeRef
fn borrow_mut(&mut self) -> &mut Asn1TimeRef
Mutably borrows from an owned value. Read more
§impl Deref for Asn1Time
impl Deref for Asn1Time
§type Target = Asn1TimeRef
type Target = Asn1TimeRef
The resulting type after dereferencing.
§fn deref(&self) -> &Asn1TimeRef
fn deref(&self) -> &Asn1TimeRef
Dereferences the value.
§impl DerefMut for Asn1Time
impl DerefMut for Asn1Time
§fn deref_mut(&mut self) -> &mut Asn1TimeRef
fn deref_mut(&mut self) -> &mut Asn1TimeRef
Mutably dereferences the value.
§impl ForeignType for Asn1Time
impl ForeignType for Asn1Time
§impl<'a> PartialEq<&'a Asn1TimeRef> for Asn1Time
impl<'a> PartialEq<&'a Asn1TimeRef> for Asn1Time
§impl PartialEq<Asn1Time> for &Asn1TimeRef
impl PartialEq<Asn1Time> for &Asn1TimeRef
§impl PartialEq<Asn1Time> for Asn1TimeRef
impl PartialEq<Asn1Time> for Asn1TimeRef
§impl PartialEq<Asn1TimeRef> for Asn1Time
impl PartialEq<Asn1TimeRef> for Asn1Time
§impl<'a> PartialOrd<&'a Asn1TimeRef> for Asn1Time
impl<'a> PartialOrd<&'a Asn1TimeRef> for Asn1Time
§impl PartialOrd<Asn1Time> for &Asn1TimeRef
impl PartialOrd<Asn1Time> for &Asn1TimeRef
§impl PartialOrd<Asn1Time> for Asn1TimeRef
impl PartialOrd<Asn1Time> for Asn1TimeRef
§impl PartialOrd<Asn1TimeRef> for Asn1Time
impl PartialOrd<Asn1TimeRef> for Asn1Time
§impl PartialOrd for Asn1Time
impl PartialOrd for Asn1Time
impl Send for Asn1Time
impl Sync for Asn1Time
Auto Trait Implementations§
impl Freeze for Asn1Time
impl RefUnwindSafe for Asn1Time
impl Unpin for Asn1Time
impl UnwindSafe for Asn1Time
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
§fn and<P, B, E>(self, other: P) -> And<T, P>
fn and<P, B, E>(self, other: P) -> And<T, P>
Create a new
Policy
that returns Action::Follow
only if self
and other
return
Action::Follow
. Read more