Skip to main content

ContextSwitchCallback

Trait ContextSwitchCallback 

Source
pub trait ContextSwitchCallback {
    // Required method
    fn context_switch_hook(&self, process: &dyn Process);
}
Expand description

Trait for implementing handlers on userspace context switches.

Required Methods§

Source

fn context_switch_hook(&self, process: &dyn Process)

This function is called before the kernel switches to a process.

process is the app that is about to run

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl ContextSwitchCallback for ()

Implement default ContextSwitchCallback trait for unit.

Source§

fn context_switch_hook(&self, _process: &dyn Process)

Implementors§