Trait sauron_core::AttributeMapMsg
source · pub trait AttributeMapMsg<MSG>where
MSG: 'static,{
// Required methods
fn map_msg<F, MSG2>(self, func: F) -> Attribute<MSG2>
where F: Fn(MSG) -> MSG2 + 'static,
MSG2: 'static;
fn map_callback<MSG2>(self, cb: Listener<MSG, MSG2>) -> Attribute<MSG2>
where MSG2: 'static;
fn get_callback(&self) -> Vec<&Listener<Event, MSG>>;
}
Expand description
Add mapping function for Attribute
Required Methods§
sourcefn map_msg<F, MSG2>(self, func: F) -> Attribute<MSG2>where
F: Fn(MSG) -> MSG2 + 'static,
MSG2: 'static,
fn map_msg<F, MSG2>(self, func: F) -> Attribute<MSG2>where F: Fn(MSG) -> MSG2 + 'static, MSG2: 'static,
map the msg
sourcefn map_callback<MSG2>(self, cb: Listener<MSG, MSG2>) -> Attribute<MSG2>where
MSG2: 'static,
fn map_callback<MSG2>(self, cb: Listener<MSG, MSG2>) -> Attribute<MSG2>where MSG2: 'static,
transform the callback of this attribute
sourcefn get_callback(&self) -> Vec<&Listener<Event, MSG>>
fn get_callback(&self) -> Vec<&Listener<Event, MSG>>
return the callback values of this attribute