[−][src]Trait savory_core::prelude::MessageMapper
Associated Types
type SelfWithOtherMs
Required methods
fn map_msg(
self,
f: impl Clone + FnOnce(Ms) -> OtherMs + 'static
) -> Self::SelfWithOtherMs
self,
f: impl Clone + FnOnce(Ms) -> OtherMs + 'static
) -> Self::SelfWithOtherMs
Implementations on Foreign Types
impl<Ms, OtherMs> MessageMapper<Ms, OtherMs> for Vec<El<Ms>> where
Ms: 'static,
OtherMs: 'static,
[src]
Ms: 'static,
OtherMs: 'static,
type SelfWithOtherMs = Vec<El<OtherMs>>
fn map_msg(
self,
f: impl Clone + FnOnce(Ms) -> OtherMs + 'static
) -> Vec<El<OtherMs>>
[src]
self,
f: impl Clone + FnOnce(Ms) -> OtherMs + 'static
) -> Vec<El<OtherMs>>
impl<Ms, OtherMs> MessageMapper<Ms, OtherMs> for El<Ms> where
Ms: 'static,
OtherMs: 'static,
[src]
Ms: 'static,
OtherMs: 'static,
type SelfWithOtherMs = El<OtherMs>
fn map_msg(self, f: impl Clone + FnOnce(Ms) -> OtherMs + 'static) -> El<OtherMs>
[src]
Maps an element's message to have another message.
This allows third party components to integrate with your application without having to know about your Msg type beforehand.
Note
There is an overhead to calling this versus keeping all messages under one type. The deeper the nested structure of children, the more time this will take to run.
impl<Ms, OtherMs> MessageMapper<Ms, OtherMs> for EventHandler<Ms> where
Ms: 'static,
OtherMs: 'static,
[src]
Ms: 'static,
OtherMs: 'static,
type SelfWithOtherMs = EventHandler<OtherMs>
fn map_msg(
self,
msg_mapper: impl Clone + FnOnce(Ms) -> OtherMs + 'static
) -> EventHandler<OtherMs>
[src]
self,
msg_mapper: impl Clone + FnOnce(Ms) -> OtherMs + 'static
) -> EventHandler<OtherMs>
impl<Ms, OtherMs, GMs> MessageMapper<Ms, OtherMs> for Effect<Ms, GMs> where
Ms: 'static,
OtherMs: 'static,
[src]
Ms: 'static,
OtherMs: 'static,
type SelfWithOtherMs = Effect<OtherMs, GMs>
fn map_msg(
self,
f: impl Clone + FnOnce(Ms) -> OtherMs + 'static
) -> Effect<OtherMs, GMs>
[src]
self,
f: impl Clone + FnOnce(Ms) -> OtherMs + 'static
) -> Effect<OtherMs, GMs>
impl<Ms, OtherMs> MessageMapper<Ms, OtherMs> for Vec<Node<Ms>> where
Ms: 'static,
OtherMs: 'static,
[src]
Ms: 'static,
OtherMs: 'static,
type SelfWithOtherMs = Vec<Node<OtherMs>>
fn map_msg(
self,
f: impl Clone + FnOnce(Ms) -> OtherMs + 'static
) -> Vec<Node<OtherMs>>
[src]
self,
f: impl Clone + FnOnce(Ms) -> OtherMs + 'static
) -> Vec<Node<OtherMs>>
impl<Ms, OtherMs> MessageMapper<Ms, OtherMs> for EventHandlerManager<Ms> where
Ms: 'static,
OtherMs: 'static,
[src]
Ms: 'static,
OtherMs: 'static,
type SelfWithOtherMs = EventHandlerManager<OtherMs>
fn map_msg(
self,
f: impl Clone + FnOnce(Ms) -> OtherMs + 'static
) -> EventHandlerManager<OtherMs>
[src]
self,
f: impl Clone + FnOnce(Ms) -> OtherMs + 'static
) -> EventHandlerManager<OtherMs>
Note: Listeners will be automatically detached and removed.
You have to call attach_listeners
to recreate them.
Implementors
impl<Ms, OtherMs> MessageMapper<Ms, OtherMs> for Node<Ms> where
Ms: 'static,
OtherMs: 'static,
[src]
Ms: 'static,
OtherMs: 'static,