pub struct ParsedTimestamp {
pub datetime: NaiveDateTime,
pub precision: TimestampPrecision,
pub fractional_seconds: Option<u32>,
}Expand description
Parsed HL7 timestamp with precision information
Fields§
§datetime: NaiveDateTimeThe parsed datetime
precision: TimestampPrecisionThe precision of the timestamp
fractional_seconds: Option<u32>Fractional seconds (if present)
Implementations§
Source§impl ParsedTimestamp
impl ParsedTimestamp
Sourcepub fn new(datetime: NaiveDateTime, precision: TimestampPrecision) -> Self
pub fn new(datetime: NaiveDateTime, precision: TimestampPrecision) -> Self
Create a new parsed timestamp
Sourcepub fn with_fractional(datetime: NaiveDateTime, fractional: u32) -> Self
pub fn with_fractional(datetime: NaiveDateTime, fractional: u32) -> Self
Create with fractional seconds
Sourcepub fn is_same_day(&self, other: &ParsedTimestamp) -> bool
pub fn is_same_day(&self, other: &ParsedTimestamp) -> bool
Check if two timestamps are on the same day
Sourcepub fn is_before(&self, other: &ParsedTimestamp) -> bool
pub fn is_before(&self, other: &ParsedTimestamp) -> bool
Check if this timestamp is before another (strictly less than)
Sourcepub fn is_after(&self, other: &ParsedTimestamp) -> bool
pub fn is_after(&self, other: &ParsedTimestamp) -> bool
Check if this timestamp is after another
Sourcepub fn is_equal(&self, other: &ParsedTimestamp) -> bool
pub fn is_equal(&self, other: &ParsedTimestamp) -> bool
Check if this timestamp is equal to another (considering precision)
Sourcepub fn to_hl7_string(&self) -> String
pub fn to_hl7_string(&self) -> String
Format as HL7 TS string
Trait Implementations§
Source§impl Clone for ParsedTimestamp
impl Clone for ParsedTimestamp
Source§fn clone(&self) -> ParsedTimestamp
fn clone(&self) -> ParsedTimestamp
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ParsedTimestamp
impl Debug for ParsedTimestamp
Source§impl PartialEq for ParsedTimestamp
impl PartialEq for ParsedTimestamp
impl Eq for ParsedTimestamp
impl StructuralPartialEq for ParsedTimestamp
Auto Trait Implementations§
impl Freeze for ParsedTimestamp
impl RefUnwindSafe for ParsedTimestamp
impl Send for ParsedTimestamp
impl Sync for ParsedTimestamp
impl Unpin for ParsedTimestamp
impl UnsafeUnpin for ParsedTimestamp
impl UnwindSafe for ParsedTimestamp
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