pub struct Interrupt { /* private fields */ }Expand description
An interrupt.
This is output by an implementation of ExternalDevice::poll_interrupt if an interrupt should occur.
Implementations§
source§impl Interrupt
impl Interrupt
sourcepub fn vectored(vect: u8, priority: u8) -> Self
pub fn vectored(vect: u8, priority: u8) -> Self
Creates a new vectored interrupt.
Note that the priority is truncated to 3 bits.
sourcepub fn external(e: impl Error + Send + Sync + 'static) -> Self
pub fn external(e: impl Error + Send + Sync + 'static) -> Self
Creates a new external interrupt (one not handled by the OS).
When this type of interrupt is raised, the simulator raises SimErr::Interrupt
which can be used to handle the resulting InterruptErr.
One example where this is used is in Python bindings.
In that case, we want to be able to halt the Simulator on a KeyboardInterrupt.
However, by default, Python cannot signal to the Rust library that a KeyboardInterrupt
has occurred. Thus, we can add a signal handler as an external interrupt to allow the KeyboardInterrupt
to be handled properly.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Interrupt
impl !RefUnwindSafe for Interrupt
impl Send for Interrupt
impl Sync for Interrupt
impl Unpin for Interrupt
impl !UnwindSafe for Interrupt
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