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§
sourcetype Id: ResourceId
type Id: ResourceId
Resource identifier type.
sourcetype Event
type Event
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§
sourcefn id(&self) -> Self::Id
fn id(&self) -> Self::Id
Method returning the ResourceId
.