Trait DateResultExt

Source
pub trait DateResultExt {
    // Required methods
    fn or_next_valid(&self) -> Date;
    fn or_prev_valid(&self) -> Date;
}
Expand description

Extension for Result<Date> to round invalid dates.

Required Methods§

Source

fn or_next_valid(&self) -> Date

Get the date or the next valid date.

This function gives the first day of the next month for the invalid date. It ignores any excess days in the invalid date.

Source

fn or_prev_valid(&self) -> Date

Get the date or the next valid date.

This function gives the last day of the current month for the invalid date. It ignores any excess days in the invalid date.

Implementations on Foreign Types§

Source§

impl DateResultExt for Result<Date, InvalidDayOfMonth>

Implementors§