[−][src]Struct seed::virtual_dom::event_handler_manager::EventHandlerManager
Manages event handlers and listeners for elements.
Methods
impl<Ms> EventHandlerManager<Ms>
[src]
pub fn new() -> Self
[src]
Creates an empty manager instance.
pub fn with_event_handlers(event_handlers: Vec<EventHandler<Ms>>) -> Self
[src]
Creates a new manager instance with given event handlers.
It doesn't create listeners automatically - you have to call attach_listeners
.
pub fn attach_listeners(
&mut self,
event_target: impl Into<EventTarget> + 'static,
old_manager: Option<&mut EventHandlerManager<Ms>>,
mailbox: &Mailbox<Ms>
)
[src]
&mut self,
event_target: impl Into<EventTarget> + 'static,
old_manager: Option<&mut EventHandlerManager<Ms>>,
mailbox: &Mailbox<Ms>
)
Creates missing listeners and attaches them to the given event_target
.
It can reuse listeners from the old_manager
.
pub fn add_event_handlers(&mut self, event_handlers: Vec<EventHandler<Ms>>)
[src]
Add new event handlers into the manager.
It doesn't create listeners automatically - you have to call attach_listeners
.
pub fn take_and_setup_listener(
&mut self,
trigger: &Ev,
event_handlers: Rc<RefCell<Vec<EventHandler<Ms>>>>
) -> Option<Listener<Ms>>
[src]
&mut self,
trigger: &Ev,
event_handlers: Rc<RefCell<Vec<EventHandler<Ms>>>>
) -> Option<Listener<Ms>>
This method is used in attach_listeners
method to move listeners from the old manager.
Trait Implementations
impl<Ms> Clone for EventHandlerManager<Ms>
[src]
fn clone(&self) -> Self
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl<Ms: Debug> Debug for EventHandlerManager<Ms>
[src]
impl<Ms: Default> Default for EventHandlerManager<Ms>
[src]
fn default() -> EventHandlerManager<Ms>
[src]
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]
self,
f: impl FnOnce(Ms) -> OtherMs + 'static + Clone
) -> EventHandlerManager<OtherMs>
Note: Listeners will be automatically detached and removed.
You have to call attach_listeners
to recreate them.
Auto Trait Implementations
impl<Ms> !RefUnwindSafe for EventHandlerManager<Ms>
impl<Ms> !Send for EventHandlerManager<Ms>
impl<Ms> !Sync for EventHandlerManager<Ms>
impl<Ms> Unpin for EventHandlerManager<Ms>
impl<Ms> !UnwindSafe for EventHandlerManager<Ms>
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,
fn borrow_mut(&mut self) -> &mut 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.
fn to_owned(&self) -> T
[src]
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.
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>,