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<UTCTimeRepr>> for UtcTimeAsn1
impl PartialEq<Date<UTCTimeRepr>> for UtcTimeAsn1
Source§impl<TR: PartialOrd + TimeRepr> PartialOrd for Date<TR>
impl<TR: PartialOrd + TimeRepr> PartialOrd for Date<TR>
Source§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> StructuralPartialEq for Date<TR>
Auto Trait Implementations§
impl<TR> Freeze for Date<TR>
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