Trait components_arena::ComponentId
source · pub trait ComponentId<const host: bool = true>: Debug + Copy + Eq + Ord + Hash + Send + Sync {
// Required methods
fn from_raw(raw: (usize, NonZeroUsize)) -> Self;
fn into_raw(self) -> (usize, NonZeroUsize);
}
Expand description
An implementer of the ComponentId
trait is a type behaves as
Id
.
Required Methods§
sourcefn from_raw(raw: (usize, NonZeroUsize)) -> Self
fn from_raw(raw: (usize, NonZeroUsize)) -> Self
Forms an id from the into_raw
function result.
sourcefn into_raw(self) -> (usize, NonZeroUsize)
fn into_raw(self) -> (usize, NonZeroUsize)
Transforms the id to primitive-typed parts, which can be easily passed through FFI and stored in non-generic context.
Use from_raw
to get the source id back.