Expand description
A thinly-wrapped HashMap
holding DOM attributes
Fields
vals: IndexMap<At, AtValue>
Implementations
sourceimpl Attrs
impl Attrs
pub const fn new(vals: IndexMap<At, AtValue>) -> Self
pub fn empty() -> Self
sourcepub fn from_id(name: impl Into<AtValue>) -> Self
pub fn from_id(name: impl Into<AtValue>) -> Self
Convenience function. Ideal when there’s one id, and no other attrs. Generally called with the id! macro.
sourcepub fn add_multiple(&mut self, key: At, items: &[&str])
pub fn add_multiple(&mut self, key: At, items: &[&str])
Add multiple values for a single attribute. Useful for classes.
Trait Implementations
impl StructuralPartialEq for Attrs
Auto Trait Implementations
impl RefUnwindSafe for Attrs
impl Send for Attrs
impl Sync for Attrs
impl Unpin for Attrs
impl UnwindSafe for Attrs
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more