Struct oxygengine_core::ecs::TypeInfo[][src]

pub struct TypeInfo { /* fields omitted */ }
Expand description

Metadata required to store a component.

All told, this means a TypeId, to be able to dynamically name/check the component type; a Layout, so that we know how to allocate memory for this component type; and a drop function which internally calls core::ptr::drop_in_place with the correct type parameter.

Implementations

Construct a TypeInfo directly from the static type.

Construct a TypeInfo from its components. This is useful in the rare case that you have some kind of pointer to raw bytes/erased memory holding a component type, coming from a source unrelated to hecs, and you want to treat it as an insertable component by implementing the DynamicBundle API.

Access the TypeId for this component type.

Access the Layout of this component type.

Directly call the destructor on a pointer to data of this component type.

Safety

All of the caveats of core::ptr::drop_in_place apply, with the additional requirement that this method is being called on a pointer to an object of the correct component type.

Get the function pointer encoding the destructor for the component type this TypeInfo represents.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Order by alignment, descending. Ties broken with TypeId.

Compares and returns the maximum of two values. Read more

Compares and returns the minimum of two values. Read more

Restrict a value to a certain interval. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

This method returns an ordering between self and other values if one exists. Read more

This method tests less than (for self and other) and is used by the < operator. Read more

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

This method tests greater than (for self and other) and is used by the > operator. Read more

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Compare self to key and return true if they are equal.

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.