pub struct Time {
pub hour: u8,
pub minute: Option<u8>,
pub second: Option<u8>,
pub microsecond: Option<u32>,
pub offset: Option<TimeStampOffset>,
}
Expand description
The results of parsing a timestamp. Note that the timestamp is not validated, i.e. it may not be a valid date or time.
Fields§
§hour: u8
The hour of the time (0-23)
minute: Option<u8>
The minute of the time (0-59)
second: Option<u8>
The second of the time (0-59)
microsecond: Option<u32>
The microsecond of the time (0-999_900)
offset: Option<TimeStampOffset>
The timezone offset of the time
Trait Implementations§
Source§impl DateTime for Time
impl DateTime for Time
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 Time
impl<'de> Deserialize<'de> for Time
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 Time
Implement Display
for Time
to allow formatting timestamps as HL7 strings
impl Display for Time
Implement Display
for Time
to allow formatting timestamps as HL7 strings
Source§impl From<NaiveTime> for Time
Convert a NaiveTime
into a Time
. The Time
will have the time components
set to the NaiveTime
’s components and the offset components set to None
.
impl From<NaiveTime> for Time
Convert a NaiveTime
into a Time
. The Time
will have the time components
set to the NaiveTime
’s components and the offset components set to None
.
Source§impl TryFrom<Time> for NaiveTime
Attempt to convert a TimeStamp
into a NaiveTime
. If the TimeStamp
is
missing time components, those components will be set to zero.
impl TryFrom<Time> for NaiveTime
Attempt to convert a TimeStamp
into a NaiveTime
. If the TimeStamp
is
missing time components, those components will be set to zero.
impl Copy for Time
impl Eq for Time
impl StructuralPartialEq for Time
Auto Trait Implementations§
impl Freeze for Time
impl RefUnwindSafe for Time
impl Send for Time
impl Sync for Time
impl Unpin for Time
impl UnwindSafe for Time
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