pub struct ParserConfig {
pub first_day: FirstDay,
pub next_weekday_means_week: bool,
pub next_day_of_month_means_month: bool,
pub next_partial_date_means_year: bool,
pub last_weekday_means_week: bool,
pub last_day_of_month_means_month: bool,
pub last_partial_date_means_year: bool,
pub today: NaiveDate,
}Fields§
§first_day: FirstDay§next_weekday_means_week: bool§next_day_of_month_means_month: bool§next_partial_date_means_year: bool§last_weekday_means_week: bool§last_day_of_month_means_month: bool§last_partial_date_means_year: bool§today: NaiveDateImplementations§
Source§impl ParserConfig
impl ParserConfig
pub fn new() -> Self
Sourcepub fn with_today(&mut self, today: NaiveDate) -> &mut Self
pub fn with_today(&mut self, today: NaiveDate) -> &mut Self
Set today’s date explicitly
Sourcepub fn week_starts_monday(&mut self) -> &mut Self
pub fn week_starts_monday(&mut self) -> &mut Self
First day of week is Monday
Sourcepub fn week_starts_sunday(&mut self) -> &mut Self
pub fn week_starts_sunday(&mut self) -> &mut Self
First day of week is Sunday
Sourcepub fn next_weekday_means_week(&mut self) -> &mut Self
pub fn next_weekday_means_week(&mut self) -> &mut Self
next Wednesday will be in 8 days if today is Tuesday
Sourcepub fn next_weekday_means_closest(&mut self) -> &mut Self
pub fn next_weekday_means_closest(&mut self) -> &mut Self
next Wednesday will be tomorrow if today is Tuesday (default)
Sourcepub fn next_day_of_month_means_month(&mut self) -> &mut Self
pub fn next_day_of_month_means_month(&mut self) -> &mut Self
next 14th will be next month if today is 13th (in ~31 days)
Sourcepub fn next_day_of_month_means_closest(&mut self) -> &mut Self
pub fn next_day_of_month_means_closest(&mut self) -> &mut Self
next 14th will be tomorrow if today is 13th (default)
Sourcepub fn next_partial_date_means_year(&mut self) -> &mut Self
pub fn next_partial_date_means_year(&mut self) -> &mut Self
next April 14th will be in 2027 if it’s 2026 now
Sourcepub fn next_partial_date_means_closest(&mut self) -> &mut Self
pub fn next_partial_date_means_closest(&mut self) -> &mut Self
next April 14th will be in one month if it’s March now (default).
Sourcepub fn last_weekday_means_week(&mut self) -> &mut Self
pub fn last_weekday_means_week(&mut self) -> &mut Self
last Wednesday was 8 days ago if today is Thursday
Sourcepub fn last_weekday_means_closest(&mut self) -> &mut Self
pub fn last_weekday_means_closest(&mut self) -> &mut Self
last Wednesday was yesterday if today is Thursday (default)
Sourcepub fn last_day_of_month_means_month(&mut self) -> &mut Self
pub fn last_day_of_month_means_month(&mut self) -> &mut Self
last 14th was in the previous month if today is 15th (in ~31 days)
Sourcepub fn last_day_of_month_means_closest(&mut self) -> &mut Self
pub fn last_day_of_month_means_closest(&mut self) -> &mut Self
last 14th was yesterday if today is 15th (default)
Sourcepub fn last_partial_date_means_year(&mut self) -> &mut Self
pub fn last_partial_date_means_year(&mut self) -> &mut Self
last April 14th was in 2025 if it’s 2026 now
Sourcepub fn last_partial_date_means_closest(&mut self) -> &mut Self
pub fn last_partial_date_means_closest(&mut self) -> &mut Self
next April 14th was in the previous month if it’s May now (default).
Trait Implementations§
Source§impl Clone for ParserConfig
impl Clone for ParserConfig
Source§fn clone(&self) -> ParserConfig
fn clone(&self) -> ParserConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more