Struct grit_data_prison::CellKey
source · pub struct CellKey { /* private fields */ }Expand description
Struct that defines a packaged index into a Prison
This struct is designed to be passed to some other struct or function that needs to be able to reference the data stored at the cell number.
Implementations§
source§impl CellKey
impl CellKey
sourcepub fn from_raw_parts(idx: usize, gen: usize) -> CellKey
pub fn from_raw_parts(idx: usize, gen: usize) -> CellKey
Create a new index from an index and generation
Not recomended in most cases, as there is no way to guarantee an item with that exact index and generation exists in your Prison
sourcepub fn into_raw_parts(&self) -> (usize, usize)
pub fn into_raw_parts(&self) -> (usize, usize)
Return the internal index and generation from the cell key, in that order
Not recomended in most cases. If you need just the index by itself, use CellKey::idx() instead