pub enum Attributes {
Vec(Vec<PositionalAttr>),
IndexMap(IndexMap<&'static str, AttrValue>),
}
Expand description
A collection of attributes for an element
Variants§
Vec(Vec<PositionalAttr>)
A vector is ideal because most of the time the list will neither change length nor key order.
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§
Source§impl Attributes
impl Attributes
Sourcepub fn iter<'a>(
&'a self,
) -> Box<dyn Iterator<Item = (&'static str, &'a str)> + 'a>
pub fn iter<'a>( &'a self, ) -> Box<dyn Iterator<Item = (&'static str, &'a str)> + 'a>
Return iterator over attribute key-value pairs
Sourcepub fn get_mut_index_map(&mut self) -> &mut IndexMap<&'static str, AttrValue>
pub fn get_mut_index_map(&mut self) -> &mut IndexMap<&'static str, AttrValue>
Get a mutable reference to the underlying IndexMap
.
If the attributes are stored in the Vec
variant, it will be converted.
Trait Implementations§
Source§impl Clone for Attributes
impl Clone for Attributes
Source§fn clone(&self) -> Attributes
fn clone(&self) -> Attributes
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for Attributes
impl Debug for Attributes
Source§impl Default for Attributes
impl Default for Attributes
Source§impl From<Vec<PositionalAttr>> for Attributes
impl From<Vec<PositionalAttr>> for Attributes
Source§fn from(v: Vec<PositionalAttr>) -> Self
fn from(v: Vec<PositionalAttr>) -> Self
Converts to this type from the input type.
Source§impl PartialEq for Attributes
impl PartialEq for Attributes
impl Eq for Attributes
impl StructuralPartialEq for Attributes
Auto Trait Implementations§
impl Freeze for Attributes
impl RefUnwindSafe for Attributes
impl Send for Attributes
impl Sync for Attributes
impl Unpin for Attributes
impl UnwindSafe for Attributes
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.Source§impl<T, V> IntoOptPropValue<V> for Twhere
T: IntoPropValue<Option<V>>,
impl<T, V> IntoOptPropValue<V> for Twhere
T: IntoPropValue<Option<V>>,
Source§fn into_opt_prop_value(self) -> Option<V>
fn into_opt_prop_value(self) -> Option<V>
Convert
self
to an optional value of a Properties
struct.Source§impl<T> IntoPropValue<Option<T>> for T
impl<T> IntoPropValue<Option<T>> for T
Source§fn into_prop_value(self) -> Option<T>
fn into_prop_value(self) -> Option<T>
Convert
self
to a value of a Properties
struct.Source§impl<T> IntoPropValue<T> for T
impl<T> IntoPropValue<T> for T
Source§fn into_prop_value(self) -> T
fn into_prop_value(self) -> T
Convert
self
to a value of a Properties
struct.