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§
Sourceconst ATTRIBUTES: &'static [AttributeDef]
const ATTRIBUTES: &'static [AttributeDef]
The attribute definition.
Sourceconst USES_FLOAT_VALUE: bool
const USES_FLOAT_VALUE: bool
See Attribute::USES_FLOAT_VALUE
. This applies to all attributes in the set.
Provided Methods§
Sourcefn attribute_value(&self) -> AttributeValue
fn attribute_value(&self) -> AttributeValue
Gets the attribute value.
Sourcefn attribute_float_value(&self) -> Option<f32>
fn attribute_float_value(&self) -> Option<f32>
Gets the attribute float value.
Sourcefn get_attribute_def_by_defindex(defindex: u32) -> Option<&'static AttributeDef>
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.