pub struct DateRange { /* private fields */ }Expand description
Validated inclusive date range. Inclusive date range used in query filters.
Implementations§
Source§impl DateRange
impl DateRange
Sourcepub fn new(start: GieDate, end: GieDate) -> Result<Self, GieError>
pub fn new(start: GieDate, end: GieDate) -> Result<Self, GieError>
Creates a validated date range (start <= end).
Sourcepub fn from(self) -> GieDate
pub fn from(self) -> GieDate
Alias for Self::start kept for compatibility with from query parameter naming.
Sourcepub fn to(self) -> GieDate
pub fn to(self) -> GieDate
Alias for Self::end kept for compatibility with to query parameter naming.
Sourcepub fn intersects(self, other: Self) -> bool
pub fn intersects(self, other: Self) -> bool
Returns true when ranges share at least one date.
Sourcepub fn is_single_day(self) -> bool
pub fn is_single_day(self) -> bool
Returns true when this range covers exactly one day.
Sourcepub fn into_bounds(self) -> (GieDate, GieDate)
pub fn into_bounds(self) -> (GieDate, GieDate)
Converts range into (start, end) bounds.
Sourcepub fn as_inclusive(self) -> RangeInclusive<GieDate>
pub fn as_inclusive(self) -> RangeInclusive<GieDate>
Returns the standard inclusive range representation.
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 UnsafeUnpin 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