Struct cftime_rs::py_bindings::PyCFDuration
source · pub struct PyCFDuration {
pub duration: CFDuration,
}Fields§
§duration: CFDurationImplementations§
source§impl PyCFDuration
impl PyCFDuration
pub fn new(seconds: i64, nanoseconds: i64, calendar: PyCFCalendar) -> Self
sourcepub fn from_years(years: i64, calendar: PyCFCalendar) -> PyCFDuration
pub fn from_years(years: i64, calendar: PyCFCalendar) -> PyCFDuration
Makes a new Duration with given number of years.
Depends on the Calendar definitions found in udunits package
pub fn from_months(months: i64, calendar: PyCFCalendar) -> PyCFDuration
pub fn from_weeks(weeks: i64, calendar: PyCFCalendar) -> PyCFDuration
pub fn from_days(days: i64, calendar: PyCFCalendar) -> PyCFDuration
pub fn from_hours(hours: i64, calendar: PyCFCalendar) -> PyCFDuration
pub fn from_minutes(minutes: i64, calendar: PyCFCalendar) -> PyCFDuration
pub fn from_seconds(seconds: i64, calendar: PyCFCalendar) -> PyCFDuration
pub fn from_milliseconds( milliseconds: i64, calendar: PyCFCalendar ) -> PyCFDuration
pub fn from_microseconds( microseconds: i64, calendar: PyCFCalendar ) -> PyCFDuration
pub fn from_nanoseconds( nanoseconds: i64, calendar: PyCFCalendar ) -> PyCFDuration
pub fn num_years(&self) -> f64
pub fn num_months(&self) -> f64
pub fn num_weeks(&self) -> f64
pub fn num_days(&self) -> f64
pub fn num_hours(&self) -> f64
pub fn num_minutes(&self) -> f64
pub fn num_seconds(&self) -> f64
pub fn num_milliseconds(&self) -> f64
pub fn num_microseconds(&self) -> f64
pub fn num_nanoseconds(&self) -> f64
Trait Implementations§
source§impl PyClassImpl for PyCFDuration
impl PyClassImpl for PyCFDuration
source§const IS_BASETYPE: bool = false
const IS_BASETYPE: bool = false
#[pyclass(subclass)]
source§const IS_SUBCLASS: bool = false
const IS_SUBCLASS: bool = false
#[pyclass(extends=…)]
source§const IS_MAPPING: bool = false
const IS_MAPPING: bool = false
#[pyclass(mapping)]
source§const IS_SEQUENCE: bool = false
const IS_SEQUENCE: bool = false
#[pyclass(sequence)]
§type Layout = PyCell<PyCFDuration>
type Layout = PyCell<PyCFDuration>
Layout
§type ThreadChecker = ThreadCheckerStub<PyCFDuration>
type ThreadChecker = ThreadCheckerStub<PyCFDuration>
This handles following two situations: Read more
§type PyClassMutability = <<PyAny as PyClassBaseType>::PyClassMutability as PyClassMutability>::MutableChild
type PyClassMutability = <<PyAny as PyClassBaseType>::PyClassMutability as PyClassMutability>::MutableChild
Immutable or mutable
§type BaseNativeType = PyAny
type BaseNativeType = PyAny
The closest native ancestor. This is
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<'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
§type AsRefTarget = PyCell<PyCFDuration>
type AsRefTarget = PyCell<PyCFDuration>
Utility type to make Py::as_ref work.
source§fn type_object_raw(py: Python<'_>) -> *mut PyTypeObject
fn type_object_raw(py: Python<'_>) -> *mut PyTypeObject
Returns the PyTypeObject instance for this type.
source§fn type_object(py: Python<'_>) -> &PyType
fn type_object(py: Python<'_>) -> &PyType
Returns the safe abstraction over the type object.
source§fn is_type_of(object: &PyAny) -> bool
fn is_type_of(object: &PyAny) -> bool
Checks if
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
Checks if
object is an instance of this type.Auto Trait Implementations§
impl RefUnwindSafe for PyCFDuration
impl Send for PyCFDuration
impl Sync for PyCFDuration
impl Unpin for PyCFDuration
impl UnwindSafe for PyCFDuration
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