Enum yew::virtual_dom::Attributes [−][src]
pub enum Attributes {
Static(&'static [[&'static str; 2]]),
Dynamic {
keys: &'static [&'static str],
values: Box<[Option<AttrValue>]>,
},
IndexMap(IndexMap<&'static str, AttrValue>),
}
Expand description
A collection of attributes for an element
Variants
Static(&'static [[&'static str; 2]])
Tuple Fields
0: &'static [[&'static str; 2]]
Static list of attributes.
Allows optimizing comparison to a simple pointer equality check and reducing allocations, if the attributes do not change on a node.
Dynamic
Fields
keys: &'static [&'static str]
Attribute keys. Includes both always set and optional attribute keys.
Static list of attribute keys with possibility to exclude attributes and dynamic attribute values.
Allows optimizing comparison to a simple pointer equality check and reducing allocations, if the attributes keys do not change on a node.
IndexMap(IndexMap<&'static str, AttrValue>)
IndexMap is used to provide runtime attribute deduplication in cases where the html! macro was not used to guarantee it.
Implementations
Return iterator over attribute key-value pairs. This function is suboptimal and does not inline well. Avoid on hot paths.
Get a mutable reference to the underlying IndexMap
.
If the attributes are stored in the Vec
variant, it will be converted.
Trait Implementations
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
This method tests for !=
.
Auto Trait Implementations
impl RefUnwindSafe for Attributes
impl !Send for Attributes
impl !Sync for Attributes
impl Unpin for Attributes
impl UnwindSafe for Attributes
Blanket Implementations
Mutably borrows from an owned value. Read more
Compare self to key
and return true
if they are equal.