pub struct Schedule { /* private fields */ }Expand description
Represents a cron schedule pattern with its methods.
For cron schedule clarification and usage examples, please refer to the crate documentation.
Implementations§
Source§impl Schedule
impl Schedule
Sourcepub fn upcoming<T: TimeZone>(
&self,
current: &DateTime<T>,
) -> Option<DateTime<T>>
pub fn upcoming<T: TimeZone>( &self, current: &DateTime<T>, ) -> Option<DateTime<T>>
Return time of the upcoming cron event, starting from the provided current value (inclusively).
If tz feature isn’t enabled,
this method assumes that schedule timezone is the same as timezone of the provided current instance.
If tz feature is enabled and schedule uses timezone,
then method calculates time of the upcoming event with respect to the schedule’s timezone:
- converts
currentinto schedule timezone; - calculates upcoming event time;
- converts obtained upcoming value back to the timezone of the
currentinstance.
Returns None if there is no time for the upcoming event.
Trait Implementations§
impl Eq for Schedule
impl StructuralPartialEq for Schedule
Auto Trait Implementations§
impl Freeze for Schedule
impl RefUnwindSafe for Schedule
impl Send for Schedule
impl Sync for Schedule
impl Unpin for Schedule
impl UnwindSafe for Schedule
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