pub struct Builder { /* private fields */ }Expand description
A builder used to configure EventListener.
Implementations§
Source§impl Builder
impl Builder
Sourcepub fn phase(self, phase: EventPhase) -> Self
pub fn phase(self, phase: EventPhase) -> Self
Set the EventPhase during which the event should be triggered.
Defaults to EventPhase::Bubble.
Sourcepub fn passive(self, passive: bool) -> Self
pub fn passive(self, passive: bool) -> Self
Set whether the listener should be passive.
Defaults to true.
Sourcepub fn listen<T, F>(self, target: T, event_type: &str, f: F) -> EventListener
pub fn listen<T, F>(self, target: T, event_type: &str, f: F) -> EventListener
Register an event listener.
Sourcepub fn listen_once<T, F>(target: T, event_type: &str, f: F) -> EventListener
pub fn listen_once<T, F>(target: T, event_type: &str, f: F) -> EventListener
Register an event listener that will be called at most once.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Builder
impl RefUnwindSafe for Builder
impl Send for Builder
impl Sync for Builder
impl Unpin for Builder
impl UnwindSafe for Builder
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more