Trait bevy_app::AppLabel

source ·
pub trait AppLabel: 'static {
    // Required method
    fn as_str(&self) -> &'static str;

    // Provided methods
    fn as_label(&self) -> AppLabelId { ... }
    fn type_id(&self) -> TypeId { ... }
}
Expand description

A strongly-typed class of labels used to identify an App.

Required Methods§

source

fn as_str(&self) -> &'static str

Returns the representation of this label as a string literal.

In cases where you absolutely need a label to be determined at runtime, you can use Box::leak to get a 'static reference.

Provided Methods§

source

fn as_label(&self) -> AppLabelId

Converts this type into an opaque, strongly-typed label.

source

fn type_id(&self) -> TypeId

Returns the [TypeId] used to differentiate labels.

Implementations on Foreign Types§

source§

impl AppLabel for &'static str

source§

fn as_str(&self) -> Self

Implementors§