Struct ed25519_dalek::pkcs8::spki::der::DateTime
pub struct DateTime { /* private fields */ }
Available on crate feature
pkcs8
only.Expand description
Date-and-time type shared by multiple ASN.1 types
(e.g. GeneralizedTime
, UTCTime
).
Following conventions from RFC 5280, this type is always Z-normalized
(i.e. represents a UTC time). However, it isn’t named “UTC time” in order
to prevent confusion with ASN.1 UTCTime
.
Implementations§
§impl DateTime
impl DateTime
pub const INFINITY: DateTime = _
pub const INFINITY: DateTime = _
This is the maximum date represented by the DateTime
This corresponds to: 9999-12-31T23:59:59Z
pub fn new(
year: u16,
month: u8,
day: u8,
hour: u8,
minutes: u8,
seconds: u8
) -> Result<DateTime, Error>
pub fn new( year: u16, month: u8, day: u8, hour: u8, minutes: u8, seconds: u8 ) -> Result<DateTime, Error>
Create a new DateTime
from the given UTC time components.
pub fn from_unix_duration(unix_duration: Duration) -> Result<DateTime, Error>
pub fn from_unix_duration(unix_duration: Duration) -> Result<DateTime, Error>
pub fn unix_duration(&self) -> Duration
pub fn unix_duration(&self) -> Duration
Compute Duration
since UNIX_EPOCH
from the given calendar date.
pub fn from_system_time(time: SystemTime) -> Result<DateTime, Error>
Available on crate feature std
only.
pub fn from_system_time(time: SystemTime) -> Result<DateTime, Error>
std
only.Instantiate from SystemTime
.
pub fn to_system_time(&self) -> SystemTime
Available on crate feature std
only.
pub fn to_system_time(&self) -> SystemTime
std
only.Convert to SystemTime
.
Trait Implementations§
§impl<'a> DecodeValue<'a> for DateTime
impl<'a> DecodeValue<'a> for DateTime
§impl EncodeValue for DateTime
impl EncodeValue for DateTime
§impl From<&DateTime> for GeneralizedTime
impl From<&DateTime> for GeneralizedTime
§fn from(datetime: &DateTime) -> GeneralizedTime
fn from(datetime: &DateTime) -> GeneralizedTime
Converts to this type from the input type.
§impl From<&GeneralizedTime> for DateTime
impl From<&GeneralizedTime> for DateTime
§fn from(utc_time: &GeneralizedTime) -> DateTime
fn from(utc_time: &GeneralizedTime) -> DateTime
Converts to this type from the input type.
§impl From<DateTime> for GeneralizedTime
impl From<DateTime> for GeneralizedTime
§fn from(datetime: DateTime) -> GeneralizedTime
fn from(datetime: DateTime) -> GeneralizedTime
Converts to this type from the input type.
§impl From<GeneralizedTime> for DateTime
impl From<GeneralizedTime> for DateTime
§fn from(utc_time: GeneralizedTime) -> DateTime
fn from(utc_time: GeneralizedTime) -> DateTime
Converts to this type from the input type.
§impl Ord for DateTime
impl Ord for DateTime
§impl PartialOrd for DateTime
impl PartialOrd for DateTime
§fn partial_cmp(&self, other: &DateTime) -> Option<Ordering>
fn partial_cmp(&self, other: &DateTime) -> 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 more§impl TryFrom<&SystemTime> for DateTime
Available on crate feature std
only.
impl TryFrom<&SystemTime> for DateTime
Available on crate feature
std
only.§impl TryFrom<SystemTime> for DateTime
Available on crate feature std
only.
impl TryFrom<SystemTime> for DateTime
Available on crate feature
std
only.impl Copy for DateTime
impl Eq for DateTime
impl StructuralPartialEq for DateTime
Auto Trait Implementations§
impl RefUnwindSafe for DateTime
impl Send for DateTime
impl Sync for DateTime
impl Unpin for DateTime
impl UnwindSafe for DateTime
Blanket Implementations§
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<'a, T> Choice<'a> for T
impl<'a, T> Choice<'a> for T
§fn can_decode(tag: Tag) -> bool
fn can_decode(tag: Tag) -> bool
Is the provided
Tag
decodable as a variant of this CHOICE
?§impl<'a, T> Decode<'a> for Twhere
T: DecodeValue<'a> + FixedTag,
impl<'a, T> Decode<'a> for Twhere
T: DecodeValue<'a> + FixedTag,
§impl<T> Encode for Twhere
T: EncodeValue + Tagged,
impl<T> Encode for Twhere
T: EncodeValue + Tagged,
§fn encoded_len(&self) -> Result<Length, Error>
fn encoded_len(&self) -> Result<Length, Error>
Compute the length of this value in bytes when encoded as ASN.1 DER.
§fn encode(&self, writer: &mut impl Writer) -> Result<(), Error>
fn encode(&self, writer: &mut impl Writer) -> Result<(), Error>
Encode this value as ASN.1 DER using the provided Writer
.
§fn encode_to_slice<'a>(&self, buf: &'a mut [u8]) -> Result<&'a [u8], Error>
fn encode_to_slice<'a>(&self, buf: &'a mut [u8]) -> Result<&'a [u8], Error>
Encode this value to the provided byte slice, returning a sub-slice
containing the encoded message.