pub trait Command {
// Required method
fn execute(&self) -> Result<(), Error>;
}Expand description
Trait that specifies the interface for concurrent task execution
Required Methods§
Sourcefn execute(&self) -> Result<(), Error>
fn execute(&self) -> Result<(), Error>
The execute method will executed in the context of one of the threads of the thread pool.
The execute method should avoid panic or returning errors, however, if errors will be returned, the last one will be passed to join handler set by crate::thread_pool_builder::ThreadPoolBuilder::with_join_error_handler
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".