pub struct AttributeEntry { /* private fields */ }Expand description
Represents a single attribute on a virtual DOM node.
Combines an attribute name with its corresponding value.
OPT 2: attribute names are Cow<'static, str>. The html! macro
emits Cow::Borrowed("class") for the common literal case so
attribute keys share a single static slice across the whole rendered
DOM, removing the per-attribute String heap allocation. The
AttributeValue::Text(String) payload keeps its owned allocation
(text values are user-supplied strings that almost always come
from string interpolation or runtime formatting).
Implementations§
Source§impl AttributeEntry
impl AttributeEntry
pub fn new(name: Cow<'static, str>, value: AttributeValue) -> Self
Trait Implementations§
Source§impl Clone for AttributeEntry
impl Clone for AttributeEntry
Source§fn clone(&self) -> AttributeEntry
fn clone(&self) -> AttributeEntry
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 AttributeEntry
impl Debug for AttributeEntry
Auto Trait Implementations§
impl !RefUnwindSafe for AttributeEntry
impl !Send for AttributeEntry
impl !Sync for AttributeEntry
impl !UnwindSafe for AttributeEntry
impl Freeze for AttributeEntry
impl Unpin for AttributeEntry
impl UnsafeUnpin for AttributeEntry
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