Struct calloop::generic::Generic[][src]

pub struct Generic<E: Evented + 'static> { /* fields omitted */ }

A generic event source wrapping an Evented type

It will simply forward the readiness and an acces to the wrapped Evented type to the suer callback. See the Event type in this module.

Methods

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

Wrap a Evented type into a Generic event source

It is initialized with no interest nor poll options, as such you should set them using the set_interest and set_pollopts methods before inserting it in the event loop.

Change the interest for this evented source

If the source was already inserted in an event loop, it needs to be re-registered for the change to take effect.

Change the poll options for this evented source

If the source was already inserted in an event loop, it needs to be re-registered for the change to take effect.

Unwrap the Generic source to retrieve the underlying Evented.

If you didn't clone the Rc<RefCell<E>> from the Event<E> you received, the returned Rc should be unique.

impl<Fd: AsRawFd> Generic<EventedFd<Fd>>
[src]

Wrap a file descriptor based source into a Generic event source.

This will only work with poll-compatible file descriptors, which typically not include basic files.

Trait Implementations

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

Register self with the given Poll instance. Read more

Re-register self with the given Poll instance. Read more

Deregister self from the given Poll instance Read more

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

The type of events generated by your sources

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 Read more

Auto Trait Implementations

impl<E> !Send for Generic<E>

impl<E> !Sync for Generic<E>