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.
Trait Implementations§
source§impl PartialEq<DateRange> for DateRange
impl PartialEq<DateRange> for DateRange
impl Copy for DateRange
impl Eq for DateRange
impl StructuralEq for DateRange
impl StructuralPartialEq for DateRange
Auto Trait Implementations§
impl RefUnwindSafe for DateRange
impl Send for DateRange
impl Sync for DateRange
impl Unpin for DateRange
impl UnwindSafe for DateRange
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