pub enum CellIdentifier {
Division(VoxelPlainIndex, u64),
Initial(usize),
Inserted(VoxelPlainIndex, u64),
}Expand description
Unique identifier which is given to every cell in the simulation
The identifier is comprised of the VoxelPlainIndex in which the cell was first spawned. This can be due to initial setup or due to other methods such as division in a cell cycle. The second parameter is a counter which is unique for each voxel. This ensures that each cell obtains a unique identifier over the course of the simulation.
Variants§
Division(VoxelPlainIndex, u64)
Produced from a division process
Initial(usize)
Initially placed inside the simulation
Inserted(VoxelPlainIndex, u64)
Inserted manually by other processes
Implementations§
Source§impl CellIdentifier
impl CellIdentifier
Sourcepub fn new(voxel_plain_index: VoxelPlainIndex, counter: u64) -> Self
pub fn new(voxel_plain_index: VoxelPlainIndex, counter: u64) -> Self
Constructs a new CellIdentifier::Division
Sourcepub fn new_initial(index: usize) -> Self
pub fn new_initial(index: usize) -> Self
Construct a new CellIdentifier::Initial
Sourcepub fn new_inserted(voxel_plain_index: VoxelPlainIndex, counter: u64) -> Self
pub fn new_inserted(voxel_plain_index: VoxelPlainIndex, counter: u64) -> Self
Construct a new CellIdentifier::Inserted
Sourcepub fn __deepcopy__(&self, _memo: Bound<'_, PyDict>) -> Self
pub fn __deepcopy__(&self, _memo: Bound<'_, PyDict>) -> Self
Returns an identical clone of the identifier
Sourcepub fn __getitem__<'py>(
&self,
py: Python<'py>,
key: usize,
) -> PyResult<Bound<'py, PyAny>>
pub fn __getitem__<'py>( &self, py: Python<'py>, key: usize, ) -> PyResult<Bound<'py, PyAny>>
Implementes the __getitem__ method. Since the CellIdentifier is built like a list this
only works for the entires 0 and 1 and will yield an error otherwise
Trait Implementations§
Source§impl Clone for CellIdentifier
impl Clone for CellIdentifier
Source§fn clone(&self) -> CellIdentifier
fn clone(&self) -> CellIdentifier
1.0.0§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for CellIdentifier
impl Debug for CellIdentifier
Source§impl<'de> Deserialize<'de> for CellIdentifier
impl<'de> Deserialize<'de> for CellIdentifier
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl Hash for CellIdentifier
impl Hash for CellIdentifier
Source§impl<'py> IntoPyObject<'py> for CellIdentifier
impl<'py> IntoPyObject<'py> for CellIdentifier
Source§type Target = CellIdentifier
type Target = CellIdentifier
Source§type Output = Bound<'py, <CellIdentifier as IntoPyObject<'py>>::Target>
type Output = Bound<'py, <CellIdentifier as IntoPyObject<'py>>::Target>
Source§fn into_pyobject(
self,
py: Python<'py>,
) -> Result<<Self as IntoPyObject<'_>>::Output, <Self as IntoPyObject<'_>>::Error>
fn into_pyobject( self, py: Python<'py>, ) -> Result<<Self as IntoPyObject<'_>>::Output, <Self as IntoPyObject<'_>>::Error>
Source§impl Ord for CellIdentifier
impl Ord for CellIdentifier
Source§impl PartialEq for CellIdentifier
impl PartialEq for CellIdentifier
Source§impl PartialOrd for CellIdentifier
impl PartialOrd for CellIdentifier
Source§impl PyClass for CellIdentifier
impl PyClass for CellIdentifier
Source§impl PyClassBaseType for CellIdentifier
impl PyClassBaseType for CellIdentifier
type LayoutAsBase = PyClassObject<CellIdentifier>
type BaseNativeType = <CellIdentifier as PyClassImpl>::BaseNativeType
type Initializer = PyClassInitializer<CellIdentifier>
type PyClassMutability = <CellIdentifier as PyClassImpl>::PyClassMutability
Source§impl PyClassImpl for CellIdentifier
impl PyClassImpl for CellIdentifier
Source§const IS_BASETYPE: bool = true
const IS_BASETYPE: bool = true
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§const IS_IMMUTABLE_TYPE: bool = false
const IS_IMMUTABLE_TYPE: bool = false
Source§const RAW_DOC: &'static CStr = /// Unique identifier which is given to every cell in the simulation
///
/// The identifier is comprised of the [VoxelPlainIndex] in which the cell was first spawned.
/// This can be due to initial setup or due to other methods such as division in a cell cycle.
/// The second parameter is a counter which is unique for each voxel.
/// This ensures that each cell obtains a unique identifier over the course of the simulation.
const RAW_DOC: &'static CStr = /// Unique identifier which is given to every cell in the simulation /// /// The identifier is comprised of the [VoxelPlainIndex] in which the cell was first spawned. /// This can be due to initial setup or due to other methods such as division in a cell cycle. /// The second parameter is a counter which is unique for each voxel. /// This ensures that each cell obtains a unique identifier over the course of the simulation.
Source§const DOC: &'static CStr
const DOC: &'static CStr
text_signature if a constructor is defined. Read moreSource§type ThreadChecker = SendablePyClass<CellIdentifier>
type ThreadChecker = SendablePyClass<CellIdentifier>
Source§type PyClassMutability = <<PyAny as PyClassBaseType>::PyClassMutability as PyClassMutability>::ImmutableChild
type PyClassMutability = <<PyAny as PyClassBaseType>::PyClassMutability as PyClassMutability>::ImmutableChild
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 for CellIdentifier
impl PyClassNewTextSignature for CellIdentifier
const TEXT_SIGNATURE: &'static str = "(voxel_plain_index, counter)"
Source§impl PyClass__eq__SlotFragment<CellIdentifier> for PyClassImplCollector<CellIdentifier>
impl PyClass__eq__SlotFragment<CellIdentifier> for PyClassImplCollector<CellIdentifier>
Source§impl PyClass__lt__SlotFragment<CellIdentifier> for PyClassImplCollector<CellIdentifier>
impl PyClass__lt__SlotFragment<CellIdentifier> for PyClassImplCollector<CellIdentifier>
Source§impl PyMethods<CellIdentifier> for PyClassImplCollector<CellIdentifier>
impl PyMethods<CellIdentifier> for PyClassImplCollector<CellIdentifier>
fn py_methods(self) -> &'static PyClassItems
Source§impl PyTypeInfo for CellIdentifier
impl PyTypeInfo for CellIdentifier
Source§fn type_object_raw(py: Python<'_>) -> *mut PyTypeObject
fn type_object_raw(py: Python<'_>) -> *mut PyTypeObject
Source§fn type_object(py: Python<'_>) -> Bound<'_, PyType>
fn type_object(py: Python<'_>) -> Bound<'_, PyType>
Source§impl Serialize for CellIdentifier
impl Serialize for CellIdentifier
impl Copy for CellIdentifier
impl Eq for CellIdentifier
impl ExtractPyClassWithClone for CellIdentifier
impl StructuralPartialEq for CellIdentifier
Auto Trait Implementations§
impl Freeze for CellIdentifier
impl RefUnwindSafe for CellIdentifier
impl Send for CellIdentifier
impl Sync for CellIdentifier
impl Unpin for CellIdentifier
impl UnwindSafe for CellIdentifier
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
clone_to_uninit)Source§impl<'a, 'py, T> FromPyObject<'a, 'py> for T
impl<'a, 'py, T> FromPyObject<'a, 'py> for T
Source§impl<'py, T> IntoPyObjectExt<'py> for Twhere
T: IntoPyObject<'py>,
impl<'py, T> IntoPyObjectExt<'py> for Twhere
T: IntoPyObject<'py>,
Source§fn into_bound_py_any(self, py: Python<'py>) -> Result<Bound<'py, PyAny>, PyErr>
fn into_bound_py_any(self, py: Python<'py>) -> Result<Bound<'py, PyAny>, PyErr>
self into an owned Python object, dropping type information.