[][src]Struct mt_dom::Attribute

pub struct Attribute<NS, ATT, VAL, EVENT, MSG> { /* fields omitted */ }

These are the plain attributes of an element

Implementations

impl<NS, ATT, VAL, EVENT, MSG> Attribute<NS, ATT, VAL, EVENT, MSG>[src]

pub fn new(namespace: Option<NS>, name: ATT, value: VAL) -> Self[src]

create a plain attribute with namespace

pub fn with_multiple_values(
    namespace: Option<NS>,
    name: ATT,
    value: Vec<VAL>
) -> Self
[src]

create from multiple values

pub fn name(&self) -> &ATT[src]

return the name of this attribute

pub fn value(&self) -> &[AttValue<VAL, EVENT, MSG>][src]

return the value of this attribute

pub fn namespace(&self) -> Option<&NS>[src]

return the namespace of this attribute

pub fn get_plain(&self) -> Vec<&VAL>[src]

return the plain value if it is a plain value

impl<NS, ATT, VAL, EVENT, MSG> Attribute<NS, ATT, VAL, EVENT, MSG> where
    EVENT: 'static,
    MSG: 'static, 
[src]

pub fn map_msg<F, MSG2>(self, func: F) -> Attribute<NS, ATT, VAL, EVENT, MSG2> where
    F: Fn(MSG) -> MSG2 + 'static,
    MSG2: 'static, 
[src]

map the msg

pub fn map_callback<MSG2>(
    self,
    cb: Callback<MSG, MSG2>
) -> Attribute<NS, ATT, VAL, EVENT, MSG2> where
    MSG2: 'static, 
[src]

transform the callback of this attribute

pub fn get_callback(&self) -> Vec<&Callback<EVENT, MSG>>[src]

return the callback values of this attribute

Trait Implementations

impl<NS, ATT, VAL, EVENT, MSG> Clone for Attribute<NS, ATT, VAL, EVENT, MSG> where
    NS: Clone,
    ATT: Clone,
    VAL: Clone
[src]

Note: using the #[derive(Debug)] needs EVENT and MSG to also be Debug

The reason this is manually implemented is, so that EVENT and MSG doesn't need to be Debug as it is part of the Callback objects and are not shown.

impl<NS, ATT, VAL, EVENT, MSG> Debug for Attribute<NS, ATT, VAL, EVENT, MSG> where
    NS: Debug,
    ATT: Debug,
    VAL: Debug
[src]

Note: using the #[derive(Debug)] needs EVENT and MSG to also be Debug

The reason this is manually implemented is, so that EVENT and MSG doesn't need to be Debug as it is part of the Callback objects and are not shown.

impl<NS, ATT, VAL, EVENT, MSG> PartialEq<Attribute<NS, ATT, VAL, EVENT, MSG>> for Attribute<NS, ATT, VAL, EVENT, MSG> where
    NS: PartialEq,
    ATT: PartialEq,
    VAL: PartialEq
[src]

Note: using the #[derive(PartialEq)] needs EVENT and MSG to also be PartialEq.

The reason this is manually implemented is, so that EVENT and MSG doesn't need to be PartialEq as it is part of the Callback objects and are not compared

Auto Trait Implementations

impl<NS, ATT, VAL, EVENT, MSG> !RefUnwindSafe for Attribute<NS, ATT, VAL, EVENT, MSG>

impl<NS, ATT, VAL, EVENT, MSG> !Send for Attribute<NS, ATT, VAL, EVENT, MSG>

impl<NS, ATT, VAL, EVENT, MSG> !Sync for Attribute<NS, ATT, VAL, EVENT, MSG>

impl<NS, ATT, VAL, EVENT, MSG> Unpin for Attribute<NS, ATT, VAL, EVENT, MSG> where
    ATT: Unpin,
    NS: Unpin,
    VAL: Unpin

impl<NS, ATT, VAL, EVENT, MSG> !UnwindSafe for Attribute<NS, ATT, VAL, EVENT, MSG>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.