pub trait PyDateAccess {
// Required methods
fn get_year(&self) -> i32;
fn get_month(&self) -> u8;
fn get_day(&self) -> u8;
}
Available on non-
Py_LIMITED_API
only.Expand description
Trait for accessing the date components of a struct containing a date.
Required Methods§
Sourcefn get_year(&self) -> i32
fn get_year(&self) -> i32
Returns the year, as a positive int.
Implementations should conform to the upstream documentation: https://docs.python.org/3/c-api/datetime.html#c.PyDateTime_GET_YEAR
Sourcefn get_month(&self) -> u8
fn get_month(&self) -> u8
Returns the month, as an int from 1 through 12.
Implementations should conform to the upstream documentation: https://docs.python.org/3/c-api/datetime.html#c.PyDateTime_GET_MONTH
Sourcefn get_day(&self) -> u8
fn get_day(&self) -> u8
Returns the day, as an int from 1 through 31.
Implementations should conform to the upstream documentation: https://docs.python.org/3/c-api/datetime.html#c.PyDateTime_GET_DAY