pub struct Attribute<T: SdkValue> { /* private fields */ }Expand description
A typed configuration or gameplay-event attribute descriptor.
T selects the expected SCS tagged-union member and the decoded Rust value.
Indexed descriptors represent arrays such as wheel positions or forward
gear ratios; callers must select an explicit zero-based index for them.
Implementations§
Source§impl<T: SdkValue> Attribute<T>
impl<T: SdkValue> Attribute<T>
Sourcepub const fn new(
name: &'static CStr,
availability: GameSchemaAvailability,
) -> Self
pub const fn new( name: &'static CStr, availability: GameSchemaAvailability, ) -> Self
Creates a scalar attribute descriptor whose SDK index is SCS_U32_NIL.
Sourcepub const fn indexed(
name: &'static CStr,
availability: GameSchemaAvailability,
) -> Self
pub const fn indexed( name: &'static CStr, availability: GameSchemaAvailability, ) -> Self
Creates an attribute descriptor selected by a zero-based SDK index.
pub const fn name(self) -> &'static CStr
pub const fn is_indexed(self) -> bool
Sourcepub const fn availability(self) -> GameSchemaAvailability
pub const fn availability(self) -> GameSchemaAvailability
Official per-game schema history for this attribute.
pub const fn value_type(self) -> ScsValueType
Sourcepub const fn erase(self) -> AnyAttribute
pub const fn erase(self) -> AnyAttribute
Erases the Rust marker type while preserving the complete descriptor metadata required for catalog enumeration.
This does not decode values and does not weaken Attribute::decode.
The returned descriptor remains explicit about both the SCS value type
and indexed/scalar lookup mode.
Trait Implementations§
impl<T: SdkValue> Copy for Attribute<T>
impl<T: Eq + SdkValue> Eq for Attribute<T>
impl<T: PartialEq + SdkValue> StructuralPartialEq for Attribute<T>
Auto Trait Implementations§
impl<T> Freeze for Attribute<T>
impl<T> RefUnwindSafe for Attribute<T>
impl<T> Send for Attribute<T>
impl<T> Sync for Attribute<T>
impl<T> Unpin for Attribute<T>
impl<T> UnsafeUnpin for Attribute<T>
impl<T> UnwindSafe for Attribute<T>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more