Enum mt_dom::AttValue [−][src]
pub enum AttValue<VAL, EVENT, MSG> { Plain(VAL), Callback(Callback<EVENT, MSG>), }
Expand description
Attribute Value which can be a plain attribute or a callback
Variants
Plain value
Callback(Callback<EVENT, MSG>)
An event listener attribute
Implementations
pub fn map_callback<MSG2>(
self,
cb: Callback<MSG, MSG2>
) -> AttValue<VAL, EVENT, MSG2> where
MSG2: 'static,
pub fn map_callback<MSG2>(
self,
cb: Callback<MSG, MSG2>
) -> AttValue<VAL, EVENT, MSG2> where
MSG2: 'static,
transform att_value such that MSG becomes MSG2
return a reference to the callback if it is a callback
return true if this is a callback
Trait Implementations
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
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.
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> !UnwindSafe for AttValue<VAL, EVENT, MSG>
Blanket Implementations
Mutably borrows from an owned value. Read more