pyo3::types::datetime

Trait PyDateAccess

Source
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§

Source

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

Source

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

Source

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

Implementors§

⚠️ Internal Docs ⚠️ Not Public API 👉 Official Docs Here