[][src]Trait calloop::EventSource

pub trait EventSource: Evented {
    type Event;
    fn interest(&self) -> Ready;
fn pollopts(&self) -> PollOpt;
fn make_dispatcher<Data: 'static, F: FnMut(Self::Event, &mut Data) + 'static>(
        &self,
        callback: F
    ) -> Rc<RefCell<dyn EventDispatcher<Data>>>; }

Trait representing a source that can be inserted into an EventLoop

This is the interface between the source and the loop, you need to implement it to use your custom event sources.

Associated Types

type Event

The type of events generated by your sources

Loading content...

Required methods

fn interest(&self) -> Ready

The interest value that will be given to mio when registering your source

fn pollopts(&self) -> PollOpt

The pollopt value that will be given to mio when registering your source

fn make_dispatcher<Data: 'static, F: FnMut(Self::Event, &mut Data) + 'static>(
    &self,
    callback: F
) -> Rc<RefCell<dyn EventDispatcher<Data>>>

Wrap an user callback into a dispatcher, that will convert an mio readiness into an event

Loading content...

Implementors

impl EventSource for Signals[src]

type Event = Event

impl<E: Evented + 'static> EventSource for Generic<E>[src]

type Event = Event<E>

impl<T: 'static> EventSource for Channel<T>[src]

type Event = Event<T>

impl<T: 'static> EventSource for Timer<T>[src]

type Event = (T, TimerHandle<T>)

Loading content...