@@ -52,10 +52,8 @@ pub struct Listener<'a> {
5252/// `href="https://example.com"`.
5353#[derive(Clone, Debug)]
5454pub struct Attribute<'a> {
55− /// The attribute name, such as `id`.
56− pub name: &'a str,
57− /// The attribute value, such as `"my-thing"`.
58− pub value: &'a str,
55+ pub(crate) name: &'a str,
56+ pub(crate) value: &'a str,
5957}
6058
6159impl fmt::Debug for Listener<'_> {
@@ -71,6 +69,18 @@ impl fmt::Debug for Listener<'_> {
7169}
7270
7371impl<'a> Attribute<'a> {
72+ /// Get this attribute's name, such as `"id"` in `<div id="my-thing" />`.
73+ #[inline]
74+ pub fn name(&self) -> &'a str {
75+ self.name
76+ }
77+
78+ /// The attribute value, such as `"my-thing"` in `<div id="my-thing" />`.
79+ #[inline]
80+ pub fn value(&self) -> &'a str {
81+ self.value
82+ }
83+
7484 /// Certain attributes are considered "volatile" and can change via user
7585 /// input that we can't see when diffing against the old virtual DOM. For
7686 /// these attributes, we want to always re-set the attribute on the physical