Struct calloop::Dispatcher [−][src]
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
impl<S, F> Dispatcher<S, F> where
S: EventSource,
[src]
S: EventSource,
pub fn new<Data>(source: S, callback: F) -> Self where
F: FnMut(S::Event, &mut S::Metadata, &mut Data) -> S::Ret,
[src]
F: FnMut(S::Event, &mut S::Metadata, &mut Data) -> S::Ret,
Builds a dispatcher.
The resulting Dispatcher
pub fn as_source_ref(&self) -> Ref<'_, S>
[src]
Returns an immutable reference to the event source.
pub fn as_source_mut(&mut self) -> RefMut<'_, S>
[src]
Returns a mutable reference to the event source.
pub fn into_source_inner(self) -> S
[src]
Consumes the Dispatcher and returns the inner event source.
Panics
Panics if the Dispatcher
is still registered.
Trait Implementations
impl<S, F> Clone for Dispatcher<S, F>
[src]
fn clone(&self) -> Dispatcher<S, F>
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
Auto Trait Implementations
impl<S, F> !RefUnwindSafe for Dispatcher<S, F>
[src]
impl<S, F> !Send for Dispatcher<S, F>
[src]
impl<S, F> !Sync for Dispatcher<S, F>
[src]
impl<S, F> Unpin for Dispatcher<S, F>
[src]
impl<S, F> !UnwindSafe for Dispatcher<S, F>
[src]
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,
pub 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.
pub fn to_owned(&self) -> T
[src]
pub 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.
pub 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>,