Trait PyDateAccess
pub trait PyDateAccess {
// Required methods
fn get_year(&self) -> i32 ⓘ;
fn get_month(&self) -> u8 ⓘ;
fn get_day(&self) -> u8 ⓘ;
}
Available on crate features
dep_pyo3
and std
only.Expand description
Trait for accessing the date components of a struct containing a date.
Required Methods§
fn 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
fn 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
fn 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