EnumInfo (enums/enum_trait.rs)

bevy · crates/bevy_reflect/src/enums/enum_trait.rs · rust · Apache-2.0
dev-tools, tag:knn-classified

Trait for reflecting over enum variants, enabling dynamic inspection and manipulation.

// Source: https://github.com/bevyengine/bevy | License: Apache-2.0
// Provided via justclaw.it.com; keep this notice with the code.
use crate::generics::impl_generic_info_methods;
use crate::{
    attributes::{impl_custom_attribute_methods, CustomAttributes},
    enums::{DynamicEnum, VariantInfo, VariantType},
    ty::impl_type_methods,
    Generics, PartialReflect, ReflectCloneError, Type, TypePath,
};
use alloc::{boxed::Box, format, string::String};
use bevy_platform::collections::HashMap;
use core::slice::Iter;

/// A trait used to power [enum-like] operations via [reflection].
///
/// This allows enums to be processed and modified dynamically at runtime without
/// necessarily knowing the actual type.
/// Enums are much more complex than their struct counterparts.
/// As a result, use

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key