Trait calloop::EventSource

source ·
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>>>; }
Expand description

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.

Required Associated Types

The type of events generated by your sources

Required Methods

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

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

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

Implementors