Struct mt_dom::Attribute

source ·
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§

source§

impl<Ns, Att, Val> Attribute<Ns, Att, Val>
where Ns: PartialEq + Clone + Debug, Att: PartialEq + Clone + Debug, Val: PartialEq + Clone + Debug,

source

pub fn new(namespace: Option<Ns>, name: Att, value: Val) -> Self

create a plain attribute with namespace

source

pub fn with_multiple_values( namespace: Option<Ns>, name: Att, value: impl IntoIterator<Item = Val> ) -> Self

create from multiple values

source

pub fn name(&self) -> &Att

return the name of this attribute

source

pub fn value(&self) -> &[Val]

return the value of this attribute

source

pub fn namespace(&self) -> Option<&Ns>

return the namespace of this attribute

Trait Implementations§

source§

impl<Ns, Att, Val> Clone for Attribute<Ns, Att, Val>
where Ns: PartialEq + Clone + Debug + Clone, Att: PartialEq + Clone + Debug + Clone, Val: PartialEq + Clone + Debug + Clone,

source§

fn clone(&self) -> Attribute<Ns, Att, Val>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<Ns, Att, Val> Debug for Attribute<Ns, Att, Val>
where Ns: PartialEq + Clone + Debug + Debug, Att: PartialEq + Clone + Debug + Debug, Val: PartialEq + Clone + Debug + Debug,

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<Ns, Att, Val> PartialEq for Attribute<Ns, Att, Val>

source§

fn eq(&self, other: &Attribute<Ns, Att, Val>) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<Ns, Att, Val> Eq for Attribute<Ns, Att, Val>
where Ns: PartialEq + Clone + Debug + Eq, Att: PartialEq + Clone + Debug + Eq, Val: PartialEq + Clone + Debug + Eq,

source§

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>

§

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§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.