ConstIdentify

Trait ConstIdentify 

Source
pub unsafe trait ConstIdentify {
    const CONST_ID: ConstId;
}
Expand description

This trait is used as to mark structs with an id available in const contexts.

§Safety

This trait should only be implemented by using the #[derive] macro because it requires that a unique ID is assigned to every struct.

If you do implement this by hand, you must ensure that every impl does not have any overlapping ids.This is done in the macro by using ConstId::generate(concat!(module_path!(), "::", stringify!(StructName)))

Required Associated Constants§

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.

Implementors§