pub struct PyTzInfo(/* private fields */);
Expand description
Bindings for datetime.tzinfo
.
Values of this type are accessed via PyO3’s smart pointers, e.g. as
Py<PyTzInfo>
or Bound<'py, PyTzInfo>
.
This is an abstract base class and cannot be constructed directly.
For concrete time zone implementations, see timezone_utc
and
the zoneinfo
module.
Implementations§
Source§impl PyTzInfo
impl PyTzInfo
Sourcepub fn utc(py: Python<'_>) -> PyResult<Borrowed<'static, '_, PyTzInfo>>
pub fn utc(py: Python<'_>) -> PyResult<Borrowed<'static, '_, PyTzInfo>>
Equivalent to datetime.timezone.utc
Sourcepub fn timezone<'py, T>(
py: Python<'py>,
iana_name: T,
) -> PyResult<Bound<'py, PyTzInfo>>where
T: IntoPyObject<'py, Target = PyString>,
pub fn timezone<'py, T>(
py: Python<'py>,
iana_name: T,
) -> PyResult<Bound<'py, PyTzInfo>>where
T: IntoPyObject<'py, Target = PyString>,
Equivalent to zoneinfo.ZoneInfo
constructor
Sourcepub fn fixed_offset<'py, T>(
py: Python<'py>,
offset: T,
) -> PyResult<Bound<'py, PyTzInfo>>where
T: IntoPyObject<'py, Target = PyDelta>,
pub fn fixed_offset<'py, T>(
py: Python<'py>,
offset: T,
) -> PyResult<Bound<'py, PyTzInfo>>where
T: IntoPyObject<'py, Target = PyDelta>,
Equivalent to datetime.timezone
constructor
Trait Implementations§
Source§impl PyTypeCheck for PyTzInfo
Available on Py_LIMITED_API
only.
impl PyTypeCheck for PyTzInfo
Available on
Py_LIMITED_API
only.impl DerefToPyAny for PyTzInfo
Auto Trait Implementations§
impl !Freeze for PyTzInfo
impl !RefUnwindSafe for PyTzInfo
impl !Send for PyTzInfo
impl !Sync for PyTzInfo
impl Unpin for PyTzInfo
impl UnwindSafe for PyTzInfo
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more