Trait pyo3::types::PyTimeAccess

source ·
pub trait PyTimeAccess {
    // Required methods
    fn get_hour(&self) -> u8;
    fn get_minute(&self) -> u8;
    fn get_second(&self) -> u8;
    fn get_microsecond(&self) -> u32;
    fn get_fold(&self) -> bool;
}
Available on non-Py_LIMITED_API only.
Expand description

Trait for accessing the time components of a struct containing a time.

Required Methods§

source

fn get_hour(&self) -> u8

Returns the hour, as an int from 0 through 23.

Implementations should conform to the upstream documentation: https://docs.python.org/3/c-api/datetime.html#c.PyDateTime_DATE_GET_HOUR

source

fn get_minute(&self) -> u8

Returns the minute, as an int from 0 through 59.

Implementations should conform to the upstream documentation: https://docs.python.org/3/c-api/datetime.html#c.PyDateTime_DATE_GET_MINUTE

source

fn get_second(&self) -> u8

Returns the second, as an int from 0 through 59.

Implementations should conform to the upstream documentation: https://docs.python.org/3/c-api/datetime.html#c.PyDateTime_DATE_GET_SECOND

source

fn get_microsecond(&self) -> u32

Returns the microsecond, as an int from 0 through 999999.

Implementations should conform to the upstream documentation: https://docs.python.org/3/c-api/datetime.html#c.PyDateTime_DATE_GET_MICROSECOND

source

fn get_fold(&self) -> bool

Returns whether this date is the later of two moments with the same representation, during a repeated interval.

This typically occurs at the end of daylight savings time. Only valid if the represented time is ambiguous. See PEP 495 for more detail.

Implementors§