pub struct CronUtil;
Implementations§
Source§impl CronUtil
impl CronUtil
Sourcepub fn next_execution_from(
expression: &str,
from: DateTime<Local>,
) -> Result<DateTime<Local>, CronError>
pub fn next_execution_from( expression: &str, from: DateTime<Local>, ) -> Result<DateTime<Local>, CronError>
Sourcepub fn count_executions_between(
expression: &str,
start: DateTime<Local>,
end: DateTime<Local>,
) -> Result<u32, CronError>
pub fn count_executions_between( expression: &str, start: DateTime<Local>, end: DateTime<Local>, ) -> Result<u32, CronError>
Sourcepub fn next_n_executions(
expression: &str,
count: usize,
) -> Result<Vec<DateTime<Local>>, CronError>
pub fn next_n_executions( expression: &str, count: usize, ) -> Result<Vec<DateTime<Local>>, CronError>
Sourcepub fn generate_cron(
month: i32,
week_day: i32,
day: i32,
hour: i32,
minute: i32,
) -> String
pub fn generate_cron( month: i32, week_day: i32, day: i32, hour: i32, minute: i32, ) -> String
根据给定的月、周、日、时、分生成 cron 表达式 Generate cron expression from given month, week day, day, hour and minute
§参数
§Parameters
month
- 月份,1-12,0 表示所有月份month
- Month, 1-12, 0 means all monthsweek_day
- 星期几,0-7(0 和 7 都表示星期日),-1 表示所有星期week_day
- Day of week, 0-7 (0 and 7 both represent Sunday), -1 means all daysday
- 日期,1-31,0 表示所有日期day
- Day of month, 1-31, 0 means all dayshour
- 小时,0-23,-1 表示所有小时hour
- Hour, 0-23, -1 means all hoursminute
- 分钟,0-59,-1 表示所有分钟minute
- Minute, 0-59, -1 means all minutes
§返回
§Returns
String
- 生成的 cron 表达式String
- Generated cron expression
Auto Trait Implementations§
impl Freeze for CronUtil
impl RefUnwindSafe for CronUtil
impl Send for CronUtil
impl Sync for CronUtil
impl Unpin for CronUtil
impl UnwindSafe for CronUtil
Blanket Implementations§
Source§impl<Src, Scheme> ApproxFrom<Src, Scheme> for Srcwhere
Scheme: ApproxScheme,
impl<Src, Scheme> ApproxFrom<Src, Scheme> for Srcwhere
Scheme: ApproxScheme,
Source§fn approx_from(src: Src) -> Result<Src, <Src as ApproxFrom<Src, Scheme>>::Err>
fn approx_from(src: Src) -> Result<Src, <Src as ApproxFrom<Src, Scheme>>::Err>
Convert the given value into an approximately equivalent representation.
Source§impl<Dst, Src, Scheme> ApproxInto<Dst, Scheme> for Srcwhere
Dst: ApproxFrom<Src, Scheme>,
Scheme: ApproxScheme,
impl<Dst, Src, Scheme> ApproxInto<Dst, Scheme> for Srcwhere
Dst: ApproxFrom<Src, Scheme>,
Scheme: ApproxScheme,
Source§type Err = <Dst as ApproxFrom<Src, Scheme>>::Err
type Err = <Dst as ApproxFrom<Src, Scheme>>::Err
The error type produced by a failed conversion.
Source§fn approx_into(self) -> Result<Dst, <Src as ApproxInto<Dst, Scheme>>::Err>
fn approx_into(self) -> Result<Dst, <Src as ApproxInto<Dst, Scheme>>::Err>
Convert the subject into an approximately equivalent representation.
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, Dst> ConvAsUtil<Dst> for T
impl<T, Dst> ConvAsUtil<Dst> for T
Source§impl<T> ConvUtil for T
impl<T> ConvUtil for T
Source§fn approx_as<Dst>(self) -> Result<Dst, Self::Err>where
Self: Sized + ApproxInto<Dst>,
fn approx_as<Dst>(self) -> Result<Dst, Self::Err>where
Self: Sized + ApproxInto<Dst>,
Approximate the subject to a given type with the default scheme.
Source§fn approx_as_by<Dst, Scheme>(self) -> Result<Dst, Self::Err>
fn approx_as_by<Dst, Scheme>(self) -> Result<Dst, Self::Err>
Approximate the subject to a given type with a specific scheme.
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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self
from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self
is actually part of its subset T
(and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset
but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self
to the equivalent element of its superset.