pub trait ComponentId<const host: bool = true>: Debug + Copy + Eq + Ord + Hash + Send + Sync {
    // Required methods
    fn from_raw(raw: RawId) -> Self;
    fn into_raw(self) -> RawId;
}
Expand description

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

Required Methods§

source

fn from_raw(raw: RawId) -> Self

Forms an id from the into_raw function result.

source

fn into_raw(self) -> RawId

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.

Implementations on Foreign Types§

§

impl<const host: bool = true> ComponentId<host> for ()

§

const fn from_raw(raw: RawId) -> Self

§

const fn into_raw(self) -> RawId

§

impl<const host: bool = true> ComponentId<host> for usize

§

const fn from_raw(raw: RawId) -> Self

§

const fn into_raw(self) -> RawId

Implementors§

§

impl<const host: bool = true> ComponentId<host> for RawId