pub struct Executor { /* private fields */ }
Expand description

An executor backed by a work queue.

Examples

The following example runs two tasks on the shared system workqueue.

use kernel::kasync::executor::workqueue::Executor;
use kernel::spawn_task;
use kernel::workqueue;

fn example_shared_workqueue() -> Result {
    let mut handle = Executor::try_new(workqueue::system())?;
    spawn_task!(handle.executor(), async {
        pr_info!("First workqueue task\n");
    })?;
    spawn_task!(handle.executor(), async {
        pr_info!("Second workqueue task\n");
    })?;
    handle.detach();
    Ok(())
}

Implementations

Creates a new workqueue-based executor using a static work queue.

Creates a new workqueue-based executor using an owned (boxed) work queue.

Trait Implementations

Starts executing a task defined by the given future. Read more

Stops the executor. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

This documentation is an old archive. Please see https://rust.docs.kernel.org instead.