pub struct Attribute<NS, ATT, VAL> where
NS: PartialEq + Clone + Debug,
ATT: PartialEq + Clone + Debug,
VAL: PartialEq + Clone + Debug, {
pub namespace: Option<NS>,
pub name: ATT,
pub value: Vec<VAL>,
}
Expand description
These are the plain attributes of an element
Fields
namespace: Option<NS>
namespace of an attribute. This is specifically used by svg attributes such as xlink-href
name: ATT
the attribute name, optional since style attribute doesn’t need to have an attribute name
value: Vec<VAL>
the attribute value, which could be a simple value, and event or a function call
Implementations
sourceimpl<NS, ATT, VAL> Attribute<NS, ATT, VAL> where
NS: PartialEq + Clone + Debug,
ATT: PartialEq + Clone + Debug,
VAL: PartialEq + Clone + Debug,
impl<NS, ATT, VAL> Attribute<NS, ATT, VAL> where
NS: PartialEq + Clone + Debug,
ATT: PartialEq + Clone + Debug,
VAL: PartialEq + Clone + Debug,
sourcepub fn new(namespace: Option<NS>, name: ATT, value: VAL) -> Self
pub fn new(namespace: Option<NS>, name: ATT, value: VAL) -> Self
create a plain attribute with namespace
sourcepub fn with_multiple_values(
namespace: Option<NS>,
name: ATT,
value: impl IntoIterator<Item = VAL>
) -> Self
pub fn with_multiple_values(
namespace: Option<NS>,
name: ATT,
value: impl IntoIterator<Item = VAL>
) -> Self
create from multiple values
Trait Implementations
sourceimpl<NS: Clone, ATT: Clone, VAL: Clone> Clone for Attribute<NS, ATT, VAL> where
NS: PartialEq + Clone + Debug,
ATT: PartialEq + Clone + Debug,
VAL: PartialEq + Clone + Debug,
impl<NS: Clone, ATT: Clone, VAL: Clone> Clone for Attribute<NS, ATT, VAL> where
NS: PartialEq + Clone + Debug,
ATT: PartialEq + Clone + Debug,
VAL: PartialEq + Clone + Debug,
sourceimpl<NS: Debug, ATT: Debug, VAL: Debug> Debug for Attribute<NS, ATT, VAL> where
NS: PartialEq + Clone + Debug,
ATT: PartialEq + Clone + Debug,
VAL: PartialEq + Clone + Debug,
impl<NS: Debug, ATT: Debug, VAL: Debug> Debug for Attribute<NS, ATT, VAL> where
NS: PartialEq + Clone + Debug,
ATT: PartialEq + Clone + Debug,
VAL: PartialEq + Clone + Debug,
sourceimpl<NS: PartialEq, ATT: PartialEq, VAL: PartialEq> PartialEq<Attribute<NS, ATT, VAL>> for Attribute<NS, ATT, VAL> where
NS: PartialEq + Clone + Debug,
ATT: PartialEq + Clone + Debug,
VAL: PartialEq + Clone + Debug,
impl<NS: PartialEq, ATT: PartialEq, VAL: PartialEq> PartialEq<Attribute<NS, ATT, VAL>> for Attribute<NS, ATT, VAL> where
NS: PartialEq + Clone + Debug,
ATT: PartialEq + Clone + Debug,
VAL: PartialEq + Clone + Debug,
impl<NS, ATT, VAL> StructuralPartialEq for Attribute<NS, ATT, VAL> where
NS: PartialEq + Clone + Debug,
ATT: PartialEq + Clone + Debug,
VAL: PartialEq + Clone + Debug,
Auto Trait Implementations
impl<NS, ATT, VAL> RefUnwindSafe for Attribute<NS, ATT, VAL> where
ATT: RefUnwindSafe,
NS: RefUnwindSafe,
VAL: RefUnwindSafe,
impl<NS, ATT, VAL> Send for Attribute<NS, ATT, VAL> where
ATT: Send,
NS: Send,
VAL: Send,
impl<NS, ATT, VAL> Sync for Attribute<NS, ATT, VAL> where
ATT: Sync,
NS: Sync,
VAL: Sync,
impl<NS, ATT, VAL> Unpin for Attribute<NS, ATT, VAL> where
ATT: Unpin,
NS: Unpin,
VAL: Unpin,
impl<NS, ATT, VAL> UnwindSafe for Attribute<NS, ATT, VAL> where
ATT: UnwindSafe,
NS: UnwindSafe,
VAL: UnwindSafe,
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
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
🔬 This is a nightly-only experimental API. (
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more