Struct picky_asn1::date::Date
source · pub struct Date<TR: TimeRepr> { /* private fields */ }
Expand description
A basic Date struct.
Implementations§
source§impl<TR: TimeRepr> Date<TR>
impl<TR: TimeRepr> Date<TR>
sourcepub unsafe fn new_unchecked(
year: u16,
month: u8,
day: u8,
hour: u8,
minute: u8,
second: u8
) -> Date<TR>
pub unsafe fn new_unchecked( year: u16, month: u8, day: u8, hour: u8, minute: u8, second: u8 ) -> Date<TR>
Create a new Date without validation.
Safety
You have to make sure you’re not building an invalid date.
pub fn new( year: u16, month: u8, day: u8, hour: u8, minute: u8, second: u8 ) -> Option<Date<TR>>
pub fn year(&self) -> u16
pub fn month(&self) -> u8
pub fn day(&self) -> u8
pub fn hour(&self) -> u8
pub fn minute(&self) -> u8
pub fn second(&self) -> u8
Trait Implementations§
source§impl<'de, TR: TimeRepr> Deserialize<'de> for Date<TR>
impl<'de, TR: TimeRepr> Deserialize<'de> for Date<TR>
source§fn deserialize<D>(
deserializer: D
) -> Result<Self, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
fn deserialize<D>( deserializer: D ) -> Result<Self, <D as Deserializer<'de>>::Error>where D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl From<Date<GeneralizedTimeRepr>> for GeneralizedTimeAsn1
impl From<Date<GeneralizedTimeRepr>> for GeneralizedTimeAsn1
source§fn from(wrapped: GeneralizedTime) -> Self
fn from(wrapped: GeneralizedTime) -> Self
Converts to this type from the input type.
source§impl From<Date<UTCTimeRepr>> for UtcTimeAsn1
impl From<Date<UTCTimeRepr>> for UtcTimeAsn1
source§impl<TR: Ord + TimeRepr> Ord for Date<TR>
impl<TR: Ord + TimeRepr> Ord for Date<TR>
source§impl PartialEq<Date<GeneralizedTimeRepr>> for GeneralizedTimeAsn1
impl PartialEq<Date<GeneralizedTimeRepr>> for GeneralizedTimeAsn1
source§fn eq(&self, other: &GeneralizedTime) -> bool
fn eq(&self, other: &GeneralizedTime) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl<TR: PartialEq + TimeRepr> PartialEq<Date<TR>> for Date<TR>
impl<TR: PartialEq + TimeRepr> PartialEq<Date<TR>> for Date<TR>
source§impl PartialEq<Date<UTCTimeRepr>> for UtcTimeAsn1
impl PartialEq<Date<UTCTimeRepr>> for UtcTimeAsn1
source§impl<TR: PartialOrd + TimeRepr> PartialOrd<Date<TR>> for Date<TR>
impl<TR: PartialOrd + TimeRepr> PartialOrd<Date<TR>> for Date<TR>
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 moresource§impl<TR: TimeRepr> Serialize for Date<TR>
impl<TR: TimeRepr> Serialize for Date<TR>
source§fn serialize<S>(
&self,
serializer: S
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
fn serialize<S>( &self, serializer: S ) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl<TR: Eq + TimeRepr> Eq for Date<TR>
impl<TR: TimeRepr> StructuralEq for Date<TR>
impl<TR: TimeRepr> StructuralPartialEq for Date<TR>
Auto Trait Implementations§
impl<TR> RefUnwindSafe for Date<TR>where TR: RefUnwindSafe,
impl<TR> Send for Date<TR>where TR: Send,
impl<TR> Sync for Date<TR>where TR: Sync,
impl<TR> Unpin for Date<TR>where TR: Unpin,
impl<TR> UnwindSafe for Date<TR>where TR: UnwindSafe,
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