pub struct Dispatcher<'a, S, Data>(_);
Expand description

An event source with its callback.

The Dispatcher can be registered in an event loop. Use the as_source_{ref,mut} functions to interact with the event source. Use into_source_inner to get the event source back.

Implementations

Builds a dispatcher.

The resulting Dispatcher

Returns an immutable reference to the event source.

Panics

Has the same semantics as RefCell::borrow().

The dispatcher being mutably borrowed while its events are dispatched, this method will panic if invoked from within the associated dispatching closure.

Returns a mutable reference to the event source.

Panics

Has the same semantics as RefCell::borrow_mut().

The dispatcher being mutably borrowed while its events are dispatched, this method will panic if invoked from within the associated dispatching closure.

Consumes the Dispatcher and returns the inner event source.

Panics

Panics if the Dispatcher is still registered.

Trait Implementations

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.