[][src]Struct localghost::events::Builder

pub struct Builder { /* fields omitted */ }

A builder used to configure EventListener.

Implementations

impl Builder[src]

pub fn new() -> Self[src]

Create a new builder.

pub fn phase(self, phase: EventPhase) -> Self[src]

Set the EventPhase during which the event should be triggered.

Defaults to EventPhase::Bubble.

pub fn passive(self, passive: bool) -> Self[src]

Set whether the listener should be passive.

Defaults to true.

pub fn listen<T, F>(self, target: T, event_type: &str, f: F) -> EventListener where
    T: AsRef<EventTarget>,
    F: FnMut(Event) + Clone + 'static, 
[src]

Register an event listener.

pub fn listen_once<T, F>(target: T, event_type: &str, f: F) -> EventListener where
    T: AsRef<EventTarget>,
    F: FnOnce(Event) + 'static, 
[src]

Register an event listener that will be called at most once.

Trait Implementations

impl Debug for Builder[src]

Auto Trait Implementations

impl RefUnwindSafe for Builder

impl Send for Builder

impl Sync for Builder

impl Unpin for Builder

impl UnwindSafe for Builder

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.