command_executor/command.rs
1/// Trait that specifies the interface for concurrent task execution
2pub trait Command {
3 /// The execute method will executed in the context of one of the threads of the thread pool.
4 ///
5 /// The execute method should avoid panic or returning errors, however, if errors will be
6 /// returned, the last one will be passed to join handler set by
7 /// [crate::thread_pool_builder::ThreadPoolBuilder::with_join_error_handler]
8 fn execute(&self) -> Result<(), anyhow::Error>;
9}