pub enum HandlerContract {
AsyncSignalSafe,
SeparateThreadWithBudget {
millis: u32,
},
}Expand description
What an implementor’s interrupt handler may do.
This is part of the contract, not trivia: a handler that is legal on one OS is undefined behavior on the other, and a caller cannot write one correctly without knowing which it has.
Variants§
AsyncSignalSafe
The handler runs on an arbitrary thread inside a signal context. No allocation, no locks, no non-reentrant libc. Anything else is UB.
SeparateThreadWithBudget
SetConsoleCtrlHandler runs the handler on a thread of its own, and the
process is killed if it has not returned within roughly this budget for
CTRL_CLOSE_EVENT. It may allocate and lock.
Trait Implementations§
Source§impl Clone for HandlerContract
impl Clone for HandlerContract
Source§fn clone(&self) -> HandlerContract
fn clone(&self) -> HandlerContract
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for HandlerContract
Source§impl Debug for HandlerContract
impl Debug for HandlerContract
impl Eq for HandlerContract
Source§impl PartialEq for HandlerContract
impl PartialEq for HandlerContract
impl StructuralPartialEq for HandlerContract
Auto Trait Implementations§
impl Freeze for HandlerContract
impl RefUnwindSafe for HandlerContract
impl Send for HandlerContract
impl Sync for HandlerContract
impl Unpin for HandlerContract
impl UnsafeUnpin for HandlerContract
impl UnwindSafe for HandlerContract
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