ComponentId

Trait ComponentId 

Source
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.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl ComponentId for (usize, NonZero<usize>)

Source§

impl ComponentId for ()

Source§

impl ComponentId for usize

Implementors§