Skip to main content

EitherTime

This class represents a time value that can be either a native Rust Time object or a Python PyTime object. It provides a unified interface for handling time data across the Rust-Python boundary, allowing for flexible processing of time-related information regardless of its origin.

Attributes

AttributeTypeDescription
RawTimeStores a native Time object used for direct temporal calculations without Python overhead.
PyBound< 'py, PyTime >Stores a reference to a Python datetime.time object for interoperability with Python-side logic.

Constructor

Signature

def EitherTime()

Signature

def Raw(
time: Time
) - > [EitherTime](eithertime.md?sid=input_datetime_eithertime)

Parameters

NameTypeDescription
timeTimeThe internal Time structure to be wrapped.

Signature

def Py(
py_time: Bound< 'py, PyTime >
) - > [EitherTime](eithertime.md?sid=input_datetime_eithertime)

Parameters

NameTypeDescription
py_timeBound< 'py, PyTime >The Python-managed time object to be wrapped.