Component

Trait Component 

Source
pub unsafe trait Component:
    Debug
    + Default
    + Copy {
    // Required methods
    fn type_id() -> ComponentTypeID;
    fn layout() -> Layout;
}
Expand description

The component trait is implemented on all component types.

This trait is unsafe, because implementing it and not returning a unique type_id can result in other safe functions on Chunks performing illegal casts.

Required Methods§

Source

fn type_id() -> ComponentTypeID

Get the unique type ID of this component.

Source

fn layout() -> Layout

Get the memory layout of an instance of this component.

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§