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§
impl Copy for DateRange
impl Eq for DateRange
impl StructuralPartialEq for DateRange
Auto Trait Implementations§
impl Freeze for DateRange
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more