[][src]Trait seed::app::message_mapper::MessageMapper

pub trait MessageMapper<Ms, OtherMs> {
    type SelfWithOtherMs;
    fn map_msg(
        self,
        f: impl FnOnce(Ms) -> OtherMs + 'static + Clone
    ) -> Self::SelfWithOtherMs; }

Associated Types

Loading content...

Required methods

fn map_msg(
    self,
    f: impl FnOnce(Ms) -> OtherMs + 'static + Clone
) -> Self::SelfWithOtherMs

Loading content...

Implementations on Foreign Types

impl<Ms: 'static, OtherMs: 'static> MessageMapper<Ms, OtherMs> for Vec<El<Ms>>[src]

type SelfWithOtherMs = Vec<El<OtherMs>>

impl<Ms: 'static, OtherMs: 'static> MessageMapper<Ms, OtherMs> for Vec<Node<Ms>>[src]

type SelfWithOtherMs = Vec<Node<OtherMs>>

Loading content...

Implementors

impl<Ms: 'static, OtherMs: 'static> MessageMapper<Ms, OtherMs> for Node<Ms>[src]

type SelfWithOtherMs = Node<OtherMs>

fn map_msg(
    self,
    f: impl FnOnce(Ms) -> OtherMs + 'static + Clone
) -> Node<OtherMs>
[src]

See note on impl for El

impl<Ms: 'static, OtherMs: 'static> MessageMapper<Ms, OtherMs> for EventHandler<Ms>[src]

type SelfWithOtherMs = EventHandler<OtherMs>

impl<Ms: 'static, OtherMs: 'static> MessageMapper<Ms, OtherMs> for EventHandlerManager<Ms>[src]

type SelfWithOtherMs = EventHandlerManager<OtherMs>

fn map_msg(
    self,
    f: impl FnOnce(Ms) -> OtherMs + 'static + Clone
) -> EventHandlerManager<OtherMs>
[src]

Note: Listeners will be automatically detached and removed. You have to call attach_listeners to recreate them.

impl<Ms: 'static, OtherMs: 'static> MessageMapper<Ms, OtherMs> for El<Ms>[src]

type SelfWithOtherMs = El<OtherMs>

fn map_msg(self, f: impl FnOnce(Ms) -> OtherMs + 'static + Clone) -> 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.

Loading content...