pub trait ComponentId: Debug + Copy + Eq + Ord + Hash + Send + Sync {
    // Required methods
    fn from_raw(raw: (usize, NonZero<usize>)) -> Self;
    fn into_raw(self) -> (usize, NonZero<usize>);
}
Expand description

An implementer of the ComponentId trait is a type behaves as Id.

Required Methods§

source

fn from_raw(raw: (usize, NonZero<usize>)) -> Self

Forms an id from the into_raw function result.

source

fn into_raw(self) -> (usize, NonZero<usize>)

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.

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl ComponentId for (usize, NonZero<usize>)

source§

const fn from_raw(raw: (usize, NonZero<usize>)) -> (usize, NonZero<usize>)

source§

const fn into_raw(self) -> (usize, NonZero<usize>)

source§

impl ComponentId for ()

source§

const fn from_raw(raw: (usize, NonZero<usize>))

source§

const fn into_raw(self) -> (usize, NonZero<usize>)

source§

impl ComponentId for usize

source§

const fn from_raw(raw: (usize, NonZero<usize>)) -> usize

source§

const fn into_raw(self) -> (usize, NonZero<usize>)

Implementors§

§

impl<C: Component> ComponentId for Id<C>