pub struct Attributes { /* private fields */ }Expand description
Attributes attached to an HTML element.
id and class have dedicated borrowed accessors; other keys share the same lookup interface.
Implementations§
Source§impl Attributes
impl Attributes
Sourcepub fn get(&self, key: &str) -> Option<AttributeValues>
pub fn get(&self, key: &str) -> Option<AttributeValues>
Returns a cloned value for key, including id and class.
Sourcepub fn contains(&self, key: &str) -> bool
pub fn contains(&self, key: &str) -> bool
Returns whether key is present, including id and class.
Sourcepub fn insert(&mut self, key: String, value: AttributeValues)
pub fn insert(&mut self, key: String, value: AttributeValues)
Inserts or replaces an attribute.
Sourcepub fn from(vec: Vec<(String, AttributeValues)>) -> Self
pub fn from(vec: Vec<(String, AttributeValues)>) -> Self
Builds a collection from key-value pairs.
Trait Implementations§
Source§impl Clone for Attributes
impl Clone for Attributes
Source§fn clone(&self) -> Attributes
fn clone(&self) -> Attributes
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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§fn default() -> Attributes
fn default() -> Attributes
Returns the “default value” for a type. Read more
impl Eq for Attributes
Source§impl PartialEq for Attributes
impl PartialEq 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 UnsafeUnpin 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