pub(crate) struct Handle {
registry: Registry,
registrations: RegistrationSet,
synced: Mutex<Synced>,
waker: Waker,
pub(crate) metrics: IoDriverMetrics,
}
Expand description
A reference to an I/O driver.
Fields§
§registry: Registry
Registers I/O resources.
registrations: RegistrationSet
Tracks all registrations
synced: Mutex<Synced>
State that should be synchronized
waker: Waker
Used to wake up the reactor from a call to turn
.
Not supported on Wasi
due to lack of threading support.
metrics: IoDriverMetrics
Implementations§
source§impl Handle
impl Handle
sourcepub(crate) fn unpark(&self)
pub(crate) fn unpark(&self)
Forces a reactor blocked in a call to turn
to wakeup, or otherwise
makes the next call to turn
return immediately.
This method is intended to be used in situations where a notification
needs to otherwise be sent to the main reactor. If the reactor is
currently blocked inside of turn
then it will wake up and soon return
after this method has been called. If the reactor is not currently
blocked in turn
, then the next call to turn
will not block and
return immediately.
sourcepub(super) fn add_source(
&self,
source: &mut impl Source,
interest: Interest,
) -> Result<Arc<ScheduledIo>>
pub(super) fn add_source( &self, source: &mut impl Source, interest: Interest, ) -> Result<Arc<ScheduledIo>>
Registers an I/O resource with the reactor for a given mio::Ready
state.
The registration token is returned.
sourcepub(super) fn deregister_source(
&self,
registration: &Arc<ScheduledIo>,
source: &mut impl Source,
) -> Result<()>
pub(super) fn deregister_source( &self, registration: &Arc<ScheduledIo>, source: &mut impl Source, ) -> Result<()>
Deregisters an I/O resource from the reactor.