Struct components_arena::ComponentClassMutex[][src]

pub struct ComponentClassMutex<C: ComponentClass, W = ComponentClassToken<C>>(_, _);
Expand description

Helps to store ComponentClassToken in a static.

Examples

macro_attr! {
    #[derive(Component!)]
    struct MyComponent { /* ... */ }
}

static MY_COMPONENT: ComponentClassMutex<MyComponent> = ComponentClassMutex::new();

// ...

let mut arena = Arena::new(&mut MY_COMPONENT.lock().unwrap());

Implementations

Creates new ComponentClassMutex instance.

The function is const, and can be used for static initialization.

Trait Implementations

Formats the value using the given formatter. Read more

The resulting type after dereferencing.

Dereferences the value.

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

Performs the conversion.

Performs the conversion.

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.