Trait reactor::Resource

source ·
pub trait Resource: AsRawFd + WriteAtomic + Send {
    type Id: ResourceId;
    type Event;

    fn id(&self) -> Self::Id;
    fn interests(&self) -> IoType ;
    fn handle_io(&mut self, io: Io) -> Option<Self::Event>;
}
Expand description

A resource which can be managed by the reactor.

Required Associated Types§

Resource identifier type.

Events which resource may generate upon receiving I/O from the reactor via Self::handle_io. These events are passed to the reactor crate::Handler.

Required Methods§

Method returning the ResourceId.

Method informing the reactor which types of events this resource is subscribed for.

Method called by the reactor when an I/O event is received for this resource in a result of poll syscall.

Implementors§