Struct dicom_core::value::range::DateRange
source · pub struct DateRange { /* private fields */ }Expand description
Represents a date range as two Option<chrono::NaiveDate> values.
None means no upper or no lower bound for range is present.
Example
use chrono::NaiveDate;
use dicom_core::value::DateRange;
let dr = DateRange::from_start(NaiveDate::from_ymd_opt(2000, 5, 3).unwrap());
assert!(dr.start().is_some());
assert!(dr.end().is_none());Implementations§
source§impl DateRange
impl DateRange
sourcepub fn from_start_to_end(
start: NaiveDate,
end: NaiveDate
) -> Result<DateRange, Error>
pub fn from_start_to_end(
start: NaiveDate,
end: NaiveDate
) -> Result<DateRange, Error>
Constructs a new DateRange from two chrono::NaiveDate values
monotonically ordered in time.
sourcepub fn from_start(start: NaiveDate) -> DateRange
pub fn from_start(start: NaiveDate) -> DateRange
Constructs a new DateRange beginning with a chrono::NaiveDate value
and no upper limit.