Attributes

Trait Attributes 

Source
pub trait Attributes: Sized {
    const DEFINDEX: &'static [u32];
    const ATTRIBUTES: &'static [AttributeDef];
    const USES_FLOAT_VALUE: bool;

    // Provided methods
    fn attribute_value(&self) -> AttributeValue { ... }
    fn attribute_float_value(&self) -> Option<f32> { ... }
    fn get_attribute_def_by_defindex(
        defindex: u32,
    ) -> Option<&'static AttributeDef> { ... }
}
Expand description

Associated attribute values for a set of item attributes.

Required Associated Constants§

Source

const DEFINDEX: &'static [u32]

The list of associated defindexes.

Source

const ATTRIBUTES: &'static [AttributeDef]

The attribute definition.

Source

const USES_FLOAT_VALUE: bool

See Attribute::USES_FLOAT_VALUE. This applies to all attributes in the set.

Provided Methods§

Source

fn attribute_value(&self) -> AttributeValue

Gets the attribute value.

Source

fn attribute_float_value(&self) -> Option<f32>

Gets the attribute float value.

Source

fn get_attribute_def_by_defindex(defindex: u32) -> Option<&'static AttributeDef>

Gets the attribute definition for a given defindex.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§