Skip to main content

ArkheComponent

Trait ArkheComponent 

Source
pub trait ArkheComponent:
    __Sealed
    + Serialize
    + for<'de> Deserialize<'de>
    + 'static {
    const TYPE_CODE: u32;
    const SCHEMA_VERSION: u16;

    // Provided methods
    fn type_code() -> TypeCode { ... }
    fn approx_size(&self) -> usize { ... }
}
Expand description

Sealed marker trait for ECS Component types. Implementations are produced only by #[derive(ArkheComponent)] — manual downstream impls are rejected by the Sealed supertrait and the Runtime dylint gate.

Canonical bytes = postcard::to_stdvec(&value) (A17 succession).

Required Associated Constants§

Source

const TYPE_CODE: u32

Globally stable dispatch code within the runtime TypeCode registry.

Source

const SCHEMA_VERSION: u16

Monotone schema version. Bump on field addition (#[serde(default)] paired); field removal / reorder forbidden.

Provided Methods§

Source

fn type_code() -> TypeCode

TypeCode wrapper convenience.

Source

fn approx_size(&self) -> usize

Approximate payload size for quota tracking. Default returns size_of::<Self>(); override for bytes::Bytes-carrying Components.

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§