[][src]Enum mt_dom::AttValue

pub enum AttValue<VAL, EVENT, MSG> {
    Plain(VAL),
    Callback(Callback<EVENT, MSG>),
}

Attribute Value which can be a plain attribute or a callback

Variants

Plain(VAL)

Plain value

Callback(Callback<EVENT, MSG>)

An event listener attribute

Implementations

impl<VAL, EVENT, MSG> AttValue<VAL, EVENT, MSG>[src]

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

return a reference to the plain value if it is a plain value

impl<VAL, EVENT, MSG> AttValue<VAL, EVENT, MSG> where
    EVENT: 'static,
    MSG: 'static, 
[src]

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

transform att_value such that MSG becomes MSG2

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

return a reference to the callback if it is a callback

pub fn is_callback(&self) -> bool[src]

return true if this is a callback

Trait Implementations

impl<VAL, EVENT, MSG> Clone for AttValue<VAL, EVENT, MSG> where
    VAL: Clone
[src]

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

The reason this is manually implemented is, so that EVENT and MSG doesn't need to be Clone as it is part of the Callback objects and cloning it is just cloning the pointer of the actual callback function

impl<VAL, EVENT, MSG> Debug for AttValue<VAL, EVENT, MSG> where
    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<VAL, EVENT, MSG> From<VAL> for AttValue<VAL, EVENT, MSG>[src]

impl<VAL, EVENT, MSG> PartialEq<AttValue<VAL, EVENT, MSG>> for AttValue<VAL, EVENT, MSG> where
    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<VAL, EVENT, MSG> !RefUnwindSafe for AttValue<VAL, EVENT, MSG>

impl<VAL, EVENT, MSG> !Send for AttValue<VAL, EVENT, MSG>

impl<VAL, EVENT, MSG> !Sync for AttValue<VAL, EVENT, MSG>

impl<VAL, EVENT, MSG> Unpin for AttValue<VAL, EVENT, MSG> where
    VAL: Unpin

impl<VAL, EVENT, MSG> !UnwindSafe for AttValue<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<!> for T[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.