pub struct PyCFDuration {
pub duration: CFDuration,
}Expand description
PyCFDuration is a wrapper around Rust CFDuration All the methods depends on the Calendar definitions found in udunits package
This duration can be added to a PyCFDatetime The result of the substraction between a PyCFDatetime and a PyCFDatetime gives a PyCFDuration
Fields§
§duration: CFDurationImplementations§
Source§impl PyCFDuration
impl PyCFDuration
Sourcepub fn new(seconds: i64, nanoseconds: i64, calendar: PyCFCalendar) -> Self
pub fn new(seconds: i64, nanoseconds: i64, calendar: PyCFCalendar) -> Self
Makes a new PyCFDuration with given number of seconds, nanoseconds and specific calendar.
Sourcepub fn from_years(years: i64, calendar: PyCFCalendar) -> PyCFDuration
pub fn from_years(years: i64, calendar: PyCFCalendar) -> PyCFDuration
Makes a new PyCFDuration with given number of years and specific calendar.
Sourcepub fn from_months(months: i64, calendar: PyCFCalendar) -> PyCFDuration
pub fn from_months(months: i64, calendar: PyCFCalendar) -> PyCFDuration
Makes a new PyCFDuration with given number of months and specific calendar.
Sourcepub fn from_weeks(weeks: i64, calendar: PyCFCalendar) -> PyCFDuration
pub fn from_weeks(weeks: i64, calendar: PyCFCalendar) -> PyCFDuration
Makes a new PyCFDuration with given number of weeks and specific calendar.
Sourcepub fn from_days(days: i64, calendar: PyCFCalendar) -> PyCFDuration
pub fn from_days(days: i64, calendar: PyCFCalendar) -> PyCFDuration
Makes a new PyCFDuration with given number of days and specific calendar.
Sourcepub fn from_hours(hours: i64, calendar: PyCFCalendar) -> PyCFDuration
pub fn from_hours(hours: i64, calendar: PyCFCalendar) -> PyCFDuration
Makes a new PyCFDuration with given number of hours and specific calendar.
Sourcepub fn from_minutes(minutes: i64, calendar: PyCFCalendar) -> PyCFDuration
pub fn from_minutes(minutes: i64, calendar: PyCFCalendar) -> PyCFDuration
Makes a new PyCFDuration with given number of minutes and specific calendar.
Sourcepub fn from_seconds(seconds: i64, calendar: PyCFCalendar) -> PyCFDuration
pub fn from_seconds(seconds: i64, calendar: PyCFCalendar) -> PyCFDuration
Makes a new PyCFDuration with given number of seconds and specific calendar.
Sourcepub fn from_milliseconds(
milliseconds: i64,
calendar: PyCFCalendar,
) -> PyCFDuration
pub fn from_milliseconds( milliseconds: i64, calendar: PyCFCalendar, ) -> PyCFDuration
Makes a new PyCFDuration with given number of milliseconds and specific calendar.
Sourcepub fn from_microseconds(
microseconds: i64,
calendar: PyCFCalendar,
) -> PyCFDuration
pub fn from_microseconds( microseconds: i64, calendar: PyCFCalendar, ) -> PyCFDuration
Makes a new PyCFDuration with given number of microseconds and specific calendar.
Sourcepub fn from_nanoseconds(
nanoseconds: i64,
calendar: PyCFCalendar,
) -> PyCFDuration
pub fn from_nanoseconds( nanoseconds: i64, calendar: PyCFCalendar, ) -> PyCFDuration
Makes a new PyCFDuration with given number of nanoseconds and specific calendar.
Sourcepub fn num_months(&self) -> f64
pub fn num_months(&self) -> f64
Returns the total number of months in the duration.
Sourcepub fn num_minutes(&self) -> f64
pub fn num_minutes(&self) -> f64
Returns the total number of minutes in the duration.
Sourcepub fn num_seconds(&self) -> f64
pub fn num_seconds(&self) -> f64
Returns the total number of seconds in the duration.
Sourcepub fn num_milliseconds(&self) -> f64
pub fn num_milliseconds(&self) -> f64
Returns the total number of milliseconds in the duration.
Sourcepub fn num_microseconds(&self) -> f64
pub fn num_microseconds(&self) -> f64
Returns the total number of microseconds in the duration.
Sourcepub fn num_nanoseconds(&self) -> f64
pub fn num_nanoseconds(&self) -> f64
Returns the total number of nanoseconds in the duration.
pub fn __sub__(&self, other: &PyCFDuration) -> PyResult<PyCFDuration>
pub fn __add__(&self, other: &PyCFDuration) -> PyResult<PyCFDuration>
pub fn __neg__(&self) -> PyCFDuration
Trait Implementations§
Source§impl PyClass for PyCFDuration
impl PyClass for PyCFDuration
Source§impl PyClassImpl for PyCFDuration
impl PyClassImpl for PyCFDuration
Source§const IS_BASETYPE: bool = false
const IS_BASETYPE: bool = false
Source§const IS_SUBCLASS: bool = false
const IS_SUBCLASS: bool = false
Source§const IS_MAPPING: bool = false
const IS_MAPPING: bool = false
Source§const IS_SEQUENCE: bool = false
const IS_SEQUENCE: bool = false
Source§type Layout = PyCell<PyCFDuration>
type Layout = PyCell<PyCFDuration>
Source§type ThreadChecker = ThreadCheckerStub<PyCFDuration>
type ThreadChecker = ThreadCheckerStub<PyCFDuration>
Source§type PyClassMutability = <<PyAny as PyClassBaseType>::PyClassMutability as PyClassMutability>::MutableChild
type PyClassMutability = <<PyAny as PyClassBaseType>::PyClassMutability as PyClassMutability>::MutableChild
Source§type BaseNativeType = PyAny
type BaseNativeType = PyAny
PyAny by default, and when you declare
#[pyclass(extends=PyDict)], it’s PyDict.fn items_iter() -> PyClassItemsIter
fn lazy_type_object() -> &'static LazyTypeObject<Self>
fn dict_offset() -> Option<isize>
fn weaklist_offset() -> Option<isize>
Source§impl PyClassNewTextSignature<PyCFDuration> for PyClassImplCollector<PyCFDuration>
impl PyClassNewTextSignature<PyCFDuration> for PyClassImplCollector<PyCFDuration>
fn new_text_signature(self) -> Option<&'static str>
Source§impl PyClass__add__SlotFragment<PyCFDuration> for PyClassImplCollector<PyCFDuration>
impl PyClass__add__SlotFragment<PyCFDuration> for PyClassImplCollector<PyCFDuration>
Source§impl PyClass__sub__SlotFragment<PyCFDuration> for PyClassImplCollector<PyCFDuration>
impl PyClass__sub__SlotFragment<PyCFDuration> for PyClassImplCollector<PyCFDuration>
Source§impl<'a, 'py> PyFunctionArgument<'a, 'py> for &'a PyCFDuration
impl<'a, 'py> PyFunctionArgument<'a, 'py> for &'a PyCFDuration
Source§impl<'a, 'py> PyFunctionArgument<'a, 'py> for &'a mut PyCFDuration
impl<'a, 'py> PyFunctionArgument<'a, 'py> for &'a mut PyCFDuration
Source§impl PyMethods<PyCFDuration> for PyClassImplCollector<PyCFDuration>
impl PyMethods<PyCFDuration> for PyClassImplCollector<PyCFDuration>
fn py_methods(self) -> &'static PyClassItems
Source§impl PyTypeInfo for PyCFDuration
impl PyTypeInfo for PyCFDuration
Source§type AsRefTarget = PyCell<PyCFDuration>
type AsRefTarget = PyCell<PyCFDuration>
Source§fn type_object_raw(py: Python<'_>) -> *mut PyTypeObject
fn type_object_raw(py: Python<'_>) -> *mut PyTypeObject
Source§fn type_object(py: Python<'_>) -> &PyType
fn type_object(py: Python<'_>) -> &PyType
Source§fn is_type_of(object: &PyAny) -> bool
fn is_type_of(object: &PyAny) -> bool
object is an instance of this type or a subclass of this type.Source§fn is_exact_type_of(object: &PyAny) -> bool
fn is_exact_type_of(object: &PyAny) -> bool
object is an instance of this type.