Skip to main content

Runnable

Trait Runnable 

Source
pub trait Runnable: Send + 'static {
    type Output: Send + 'static;

    // Required method
    fn run(self) -> Self::Output;
}
Expand description

A trait for defining a task that can be executed, typically in a separate thread.

Types implementing Runnable must be Send and 'static to ensure they can be safely transferred across thread boundaries.

Required Associated Types§

Source

type Output: Send + 'static

The type of value returned when the task completes.

Required Methods§

Source

fn run(self) -> Self::Output

Executes the task logic.

Implementors§