Trait InterruptHandle

Source
pub trait InterruptHandle:
    Debug
    + Send
    + Sync {
    // Required methods
    fn kill(&self) -> bool;
    fn dropped(&self) -> bool;
}
Expand description

A trait for handling interrupts to a sandbox’s vcpu

Required Methods§

Source

fn kill(&self) -> bool

Interrupt the corresponding sandbox from running.

  • If this is called while the vcpu is running, then it will interrupt the vcpu and return true.
  • If this is called while the vcpu is not running, (for example during a host call), the vcpu will not immediately be interrupted, but will prevent the vcpu from running the next time it’s scheduled, and returns false.
§Note

This function will block for the duration of the time it takes for the vcpu thread to be interrupted.

Source

fn dropped(&self) -> bool

Returns true if the corresponding sandbox has been dropped

Implementors§