pub(crate) struct Driver {
io: Driver,
receiver: UnixStream,
inner: Arc<()>,
}Expand description
Responsible for registering wakeups when an OS signal is received, and subsequently dispatching notifications to any signal listeners as appropriate.
Note: this driver relies on having an enabled IO driver in order to listen to pipe write wakeups.
Fields§
§io: DriverThread parker. The Driver park implementation delegates to this.
receiver: UnixStreamA pipe for receiving wake events from the signal handler
inner: Arc<()>Shared state. The driver keeps a strong ref and the handle keeps a weak ref. The weak ref is used to check if the driver is still active before trying to register a signal handler.
Implementations§
Source§impl Driver
impl Driver
Sourcepub(crate) fn new(io: Driver, io_handle: &Handle) -> Result<Self>
pub(crate) fn new(io: Driver, io_handle: &Handle) -> Result<Self>
Creates a new signal Driver instance that delegates wakeups to park.
Sourcepub(crate) fn handle(&self) -> Handle
pub(crate) fn handle(&self) -> Handle
Returns a handle to this event loop which can be sent across threads and can be used as a proxy to the event loop itself.
pub(crate) fn park(&mut self, handle: &Handle)
pub(crate) fn park_timeout(&mut self, handle: &Handle, duration: Duration)
pub(crate) fn shutdown(&mut self, handle: &Handle)
fn process(&mut self)
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for Driver
impl RefUnwindSafe for Driver
impl Send for Driver
impl Sync for Driver
impl Unpin for Driver
impl UnsafeUnpin for Driver
impl UnwindSafe for Driver
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more