[−][src]Enum mt_dom::AttValue
Attribute Value which can be a plain attribute or a callback
Variants
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]
EVENT: 'static,
MSG: 'static,
pub fn map_callback<MSG2>(
self,
cb: Callback<MSG, MSG2>
) -> AttValue<VAL, EVENT, MSG2> where
MSG2: 'static,
[src]
self,
cb: Callback<MSG, MSG2>
) -> AttValue<VAL, EVENT, MSG2> where
MSG2: 'static,
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]
VAL: Clone,
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
pub fn clone(&self) -> Self
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl<VAL, EVENT, MSG> Debug for AttValue<VAL, EVENT, MSG> where
VAL: Debug,
[src]
VAL: Debug,
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]
VAL: PartialEq,
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,
VAL: Unpin,
impl<VAL, EVENT, MSG> !UnwindSafe for AttValue<VAL, EVENT, MSG>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[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]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,