pub struct TimeRange {
pub since: DateTime<Local>,
pub until: Option<DateTime<Local>>,
}Fields§
§since: DateTime<Local>§until: Option<DateTime<Local>>Implementations§
Source§impl TimeRange
impl TimeRange
Sourcepub fn from_dates(since: NaiveDate, until: NaiveDate) -> Result<Self, String>
pub fn from_dates(since: NaiveDate, until: NaiveDate) -> Result<Self, String>
Build a range from two explicit dates (both inclusive).
Sourcepub fn from_since_date(since: NaiveDate) -> Result<Self, String>
pub fn from_since_date(since: NaiveDate) -> Result<Self, String>
Build a range from a start date to now.
Sourcepub fn with_until_date(self, until: NaiveDate) -> Result<Self, String>
pub fn with_until_date(self, until: NaiveDate) -> Result<Self, String>
Override the upper bound of an existing range.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for TimeRange
impl RefUnwindSafe for TimeRange
impl Send for TimeRange
impl Sync for TimeRange
impl Unpin for TimeRange
impl UnsafeUnpin for TimeRange
impl UnwindSafe for TimeRange
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