MdfTrait
Fully qualified path: chrono::internals::MdfTrait
pub trait MdfTrait
Trait functions
new
Makes a new Mdf value from month, day and YearFlags.
This method doesn’t fully validate the range of the month and day parameters, only as
much as what can’t be deferred until later. The year flags are trusted to be correct.
Errors
Returns None if month > 12 or day > 31.
Fully qualified path: chrono::internals::MdfTrait::new
fn new(month: u32, day: u32, flags: YearFlags) -> Option<Mdf>
from_ol
Makes a new Mdf value from an i32 with an ordinal and a leap year flag, and year
flags.
The ol is trusted to be valid, and the flags are trusted to match it.
Fully qualified path: chrono::internals::MdfTrait::from_ol
fn from_ol(ol: i32, flags: YearFlags) -> Mdf
month
Returns the month of this Mdf.
Fully qualified path: chrono::internals::MdfTrait::month
fn month(self: @Mdf) -> u32
with_month
Replaces the month of this Mdf, keeping the day and flags.
Errors
Returns None if month > 12.
Fully qualified path: chrono::internals::MdfTrait::with_month
fn with_month(self: @Mdf, month: u32) -> Option<Mdf>
day
Returns the day of this Mdf.
Fully qualified path: chrono::internals::MdfTrait::day
fn day(self: @Mdf) -> u32
with_day
Replaces the day of this Mdf, keeping the month and flags.
Errors
Returns None if day > 31.
Fully qualified path: chrono::internals::MdfTrait::with_day
fn with_day(self: @Mdf, day: u32) -> Option<Mdf>
with_flags
Replaces the flags of this Mdf, keeping the month and day.
Fully qualified path: chrono::internals::MdfTrait::with_flags
fn with_flags(self: @Mdf, flags: YearFlags) -> Mdf
ordinal
Returns the ordinal that corresponds to this Mdf.
This does a table lookup to calculate the corresponding ordinal. It will return an error if
the Mdl turns out not to be a valid date.
Errors
Returns None if month == 0 or day == 0, or if a the given day does not exist in the
given month.
Fully qualified path: chrono::internals::MdfTrait::ordinal
fn ordinal(self: @Mdf) -> Option<u32>
ordinal_and_flags
Returns the ordinal that corresponds to this Mdf, encoded as a value including year flags.
This does a table lookup to calculate the corresponding ordinal. It will return an error if
the Mdl turns out not to be a valid date.
Errors
Returns None if month == 0 or day == 0, or if a the given day does not exist in the
given month.
Fully qualified path: chrono::internals::MdfTrait::ordinal_and_flags
fn ordinal_and_flags(self: @Mdf) -> Option<u32>
valid
Fully qualified path: chrono::internals::MdfTrait::valid
fn valid(self: @Mdf) -> bool