pub struct ReDateTime {
pub at: DateTime<Utc>,
pub repeat: RepeatEvery,
pub until: DateTime<Utc>,
}
Expand description
ReDateTime
struct represents recurring datetime object
starting at at
and repeating every repeat
up to until
(inclusive).
Fields§
§at: DateTime<Utc>
§repeat: RepeatEvery
§until: DateTime<Utc>
Implementations§
Source§impl ReDateTime
impl ReDateTime
Sourcepub fn repeat(dt: DateTime<Utc>, dur: RepeatEvery) -> Self
pub fn repeat(dt: DateTime<Utc>, dur: RepeatEvery) -> Self
ReDateTime
with infinite repeat.
Sourcepub fn repeat_until(
dt: DateTime<Utc>,
dur: RepeatEvery,
til: DateTime<Utc>,
) -> Self
pub fn repeat_until( dt: DateTime<Utc>, dur: RepeatEvery, til: DateTime<Utc>, ) -> Self
ReDateTime
with a finite number of repeats.
Sourcepub fn done_before(&self, dt: &DateTime<Utc>) -> bool
pub fn done_before(&self, dt: &DateTime<Utc>) -> bool
True if there is no repeat after or on dt
.
Sourcepub fn between(&self, df: &DateTime<Utc>, dt: &DateTime<Utc>) -> bool
pub fn between(&self, df: &DateTime<Utc>, dt: &DateTime<Utc>) -> bool
True if there is a repeat between df
(inclusive) and dt
(inclusive). df
always comes earlier than dt
.
Sourcepub fn first_after(&self, df: &DateTime<Utc>) -> Option<DateTime<Utc>>
pub fn first_after(&self, df: &DateTime<Utc>) -> Option<DateTime<Utc>>
First repeat after df
(inclusive).
Sourcepub fn iter(&self) -> ReDateTimeIter<'_> ⓘ
pub fn iter(&self) -> ReDateTimeIter<'_> ⓘ
An iterator visiting datetimes in order. If repeat
is negative, the iterator runs in reverse-chronological order.
Trait Implementations§
Source§impl Clone for ReDateTime
impl Clone for ReDateTime
Source§fn clone(&self) -> ReDateTime
fn clone(&self) -> ReDateTime
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for ReDateTime
impl Debug for ReDateTime
Source§impl<'de> Deserialize<'de> for ReDateTime
impl<'de> Deserialize<'de> for ReDateTime
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for ReDateTime
impl RefUnwindSafe for ReDateTime
impl Send for ReDateTime
impl Sync for ReDateTime
impl Unpin for ReDateTime
impl UnwindSafe for ReDateTime
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
)