pub struct AnyAttribute { /* private fields */ }Expand description
A configuration or gameplay attribute after erasing its Rust marker type.
Catalogs need one homogeneous representation even though attributes decode to different Rust types. Erasure deliberately retains all metadata needed to audit the descriptor against the SDK header: the canonical name, tagged union discriminator, and whether lookup requires a zero-based index.
Normal callback code should keep using Attribute<T>, because
that preserves typed decoding. AnyAttribute is intended for enumeration,
diagnostics, schema generation, and coverage tests rather than replacing
the typed API.
Implementations§
Source§impl AnyAttribute
impl AnyAttribute
Sourcepub const fn name(self) -> &'static CStr
pub const fn name(self) -> &'static CStr
Returns the canonical, NUL-terminated attribute name from the SDK header.
Sourcepub const fn value_type(self) -> ValueType
pub const fn value_type(self) -> ValueType
Returns the SCS tagged-union member expected for this attribute.
Sourcepub const fn is_indexed(self) -> bool
pub const fn is_indexed(self) -> bool
Returns whether lookup requires an explicit zero-based SDK index.
Indexed attributes include wheel properties, transmission ratios, and
H-shifter slots. Scalar attributes must instead be looked up using the
SDK sentinel index SCS_U32_NIL.
Sourcepub const fn availability(self) -> GameSchemaAvailability
pub const fn availability(self) -> GameSchemaAvailability
Official per-game schema history retained during type erasure.
Trait Implementations§
Source§impl Clone for AnyAttribute
impl Clone for AnyAttribute
Source§fn clone(&self) -> AnyAttribute
fn clone(&self) -> AnyAttribute
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more