pub struct Date {
pub year: u16,
pub month: Option<u8>,
pub day: Option<u8>,
}
Expand description
A parsed date without a time component
Fields§
§year: u16
The year of the date
month: Option<u8>
The month of the date (1-12)
day: Option<u8>
The day of the date (1-31)
Trait Implementations§
Source§impl DateTime for Date
impl DateTime for Date
Source§fn parse(
s: &str,
lenient_trailing_chars: bool,
) -> Result<Self, DateTimeParseError>
fn parse( s: &str, lenient_trailing_chars: bool, ) -> Result<Self, DateTimeParseError>
Parse an HL7 date and/or time string into a
Date
, Time
, or TimeStamp
structSource§fn parse_strict(s: &str) -> Result<Self, DateTimeParseError>where
Self: Sized,
fn parse_strict(s: &str) -> Result<Self, DateTimeParseError>where
Self: Sized,
Parse an HL7 date and/or time string into a
Date
, Time
, or TimeStamp
struct, with
strict parsing dissallowing trailing charactersSource§impl<'de> Deserialize<'de> for Date
impl<'de> Deserialize<'de> for Date
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Display for Date
Implement Display
for TimeStamp
to allow formatting timestamps as HL7 strings
impl Display for Date
Implement Display
for TimeStamp
to allow formatting timestamps as HL7 strings
Source§impl From<NaiveDate> for Date
Convert a NaiveDate
into a Date
. The Date
will have the date
components set to the NaiveDate
’s components
impl From<NaiveDate> for Date
Convert a NaiveDate
into a Date
. The Date
will have the date
components set to the NaiveDate
’s components
Source§impl FromStr for Date
Implement FromStr
for TimeStamp
to allow parsing timestamps from strings
impl FromStr for Date
Implement FromStr
for TimeStamp
to allow parsing timestamps from strings
Source§impl TryFrom<Date> for NaiveDate
Attempt to convert a Date
into a NaiveDate
. If the Date
is missing
date components, those components will be set to 1
.
impl TryFrom<Date> for NaiveDate
Attempt to convert a Date
into a NaiveDate
. If the Date
is missing
date components, those components will be set to 1
.
impl Copy for Date
impl Eq for Date
impl StructuralPartialEq for Date
Auto Trait Implementations§
impl Freeze for Date
impl RefUnwindSafe for Date
impl Send for Date
impl Sync for Date
impl Unpin for Date
impl UnwindSafe for Date
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