pub struct PyTimeFixed {
pub storage: ResourceStorage<Time<Fixed>>,
}Fields§
§storage: ResourceStorage<Time<Fixed>>Implementations§
Source§impl PyTimeFixed
impl PyTimeFixed
Sourcepub fn from_owned(resource: Time<Fixed>) -> (Self, PyResource)
pub fn from_owned(resource: Time<Fixed>) -> (Self, PyResource)
Create from an owned resource value. Returns tuple for PyO3 class inheritance.
Sourcepub fn from_borrowed(
storage: ResourceStorage<Time<Fixed>>,
) -> (Self, PyResource)
pub fn from_borrowed( storage: ResourceStorage<Time<Fixed>>, ) -> (Self, PyResource)
Create from a borrowed resource storage (for Res/ResMut access).
pub fn as_ref(&self) -> PyResult<&Time<Fixed>>
pub fn as_mut(&mut self) -> PyResult<&mut Time<Fixed>>
Source§impl PyTimeFixed
impl PyTimeFixed
pub fn new() -> (Self, PyResource)
pub fn from_duration( py: Python<'_>, timestep: Duration, ) -> PyResult<Py<PyTimeFixed>>
pub fn from_hz(py: Python<'_>, hz: f64) -> PyResult<Py<PyTimeFixed>>
pub fn from_seconds(py: Python<'_>, seconds: f64) -> PyResult<Py<PyTimeFixed>>
pub fn timestep(&self) -> PyResult<Duration>
pub fn set_timestep(&mut self, timestep: Duration) -> PyResult<()>
pub fn set_timestep_seconds(&mut self, seconds: f64) -> PyResult<()>
pub fn set_timestep_hz(&mut self, hz: f64) -> PyResult<()>
pub fn overstep(&self) -> PyResult<Duration>
pub fn discard_overstep(&mut self, discard: Duration) -> PyResult<()>
pub fn overstep_fraction(&self) -> PyResult<f32>
pub fn overstep_fraction_f64(&self) -> PyResult<f64>
pub fn delta_secs(&self) -> PyResult<f32>
pub fn delta_secs_f64(&self) -> PyResult<f64>
pub fn elapsed(&self) -> PyResult<Duration>
pub fn elapsed_secs(&self) -> PyResult<f32>
pub fn elapsed_secs_f64(&self) -> PyResult<f64>
pub fn delta(&self) -> PyResult<Duration>
pub fn advance_to(&mut self, elapsed: Duration) -> PyResult<()>
pub fn advance_by(&mut self, delta: Duration) -> PyResult<()>
pub fn wrap_period(&self) -> PyResult<Duration>
pub fn set_wrap_period(&mut self, wrap_period: Duration) -> PyResult<()>
pub fn elapsed_wrapped(&self) -> PyResult<Duration>
pub fn elapsed_secs_wrapped(&self) -> PyResult<f32>
pub fn elapsed_secs_wrapped_f64(&self) -> PyResult<f64>
pub fn __repr__(&self) -> String
Trait Implementations§
Source§impl Clone for PyTimeFixed
impl Clone for PyTimeFixed
Source§impl Debug for PyTimeFixed
impl Debug for PyTimeFixed
Source§impl PyClass for PyTimeFixed
impl PyClass for PyTimeFixed
Source§impl PyClassImpl for PyTimeFixed
impl PyClassImpl for PyTimeFixed
Source§const IS_BASETYPE: bool = false
const IS_BASETYPE: bool = false
#[pyclass(subclass)]
Source§const IS_SUBCLASS: bool = true
const IS_SUBCLASS: bool = true
#[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)]
Source§const IS_IMMUTABLE_TYPE: bool = false
const IS_IMMUTABLE_TYPE: bool = false
#[pyclass(immutable_type)]
Source§const RAW_DOC: &'static CStr = c"\x00"
const RAW_DOC: &'static CStr = c"\x00"
Docstring for the class provided on the struct or enum. Read more
Source§const DOC: &'static CStr
const DOC: &'static CStr
Fully rendered class doc, including the
text_signature if a constructor is defined. Read moreSource§type BaseType = PyResource
type BaseType = PyResource
Base class
Source§type ThreadChecker = SendablePyClass<PyTimeFixed>
type ThreadChecker = SendablePyClass<PyTimeFixed>
This handles following two situations: Read more
type Inventory = Pyo3MethodsInventoryForPyTimeFixed
Source§type PyClassMutability = <<PyResource as PyClassBaseType>::PyClassMutability as PyClassMutability>::MutableChild
type PyClassMutability = <<PyResource as PyClassBaseType>::PyClassMutability as PyClassMutability>::MutableChild
Immutable or mutable
Source§type BaseNativeType = <<PyTimeFixed as PyClassImpl>::BaseType as PyClassBaseType>::BaseNativeType
type BaseNativeType = <<PyTimeFixed as PyClassImpl>::BaseType as PyClassBaseType>::BaseNativeType
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 for PyTimeFixed
impl PyClassNewTextSignature for PyTimeFixed
const TEXT_SIGNATURE: &'static str = "()"
Source§impl PyTypeInfo for PyTimeFixed
impl PyTypeInfo for PyTimeFixed
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<'_>) -> Bound<'_, PyType>
fn type_object(py: Python<'_>) -> Bound<'_, PyType>
Returns the safe abstraction over the type object.
impl DerefToPyAny for PyTimeFixed
impl ExtractPyClassWithClone for PyTimeFixed
Auto Trait Implementations§
impl Freeze for PyTimeFixed
impl RefUnwindSafe for PyTimeFixed
impl Send for PyTimeFixed
impl Sync for PyTimeFixed
impl Unpin for PyTimeFixed
impl UnsafeUnpin for PyTimeFixed
impl UnwindSafe for PyTimeFixed
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Converts
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Converts
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Converts
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Converts
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSend for T
impl<T> DowncastSend for T
Source§impl<'a, 'py, T> FromPyObject<'a, 'py> for T
impl<'a, 'py, T> FromPyObject<'a, 'py> for T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> IntoResult<T> for T
impl<T> IntoResult<T> for T
Source§fn into_result(self) -> Result<T, RunSystemError>
fn into_result(self) -> Result<T, RunSystemError>
Converts this type into the system output type.
Source§impl<T> PyTypeCheck for Twhere
T: PyTypeInfo,
impl<T> PyTypeCheck for Twhere
T: PyTypeInfo,
Source§const NAME: &'static str = T::NAME
const NAME: &'static str = T::NAME
👎Deprecated since 0.27.0:
Use ::classinfo_object() instead and format the type name at runtime. Note that using built-in cast features is often better than manual PyTypeCheck usage.
Name of self. This is used in error messages, for example.
Source§impl<T> TypeData for T
impl<T> TypeData for T
Source§fn clone_type_data(&self) -> Box<dyn TypeData>
fn clone_type_data(&self) -> Box<dyn TypeData>
Creates a type-erased clone of this value.