zp_task_params

Macro zp_task_params 

Source
macro_rules! zp_task_params {
    ($struct_name:ident { $($field:ident: $field_type:ty),* $(,)? }) => { ... };
}
Expand description

Create a task parameter struct with automatic constructor

This macro generates a struct with the specified fields and a new method that takes all fields as parameters in declaration order.

ยงExamples

use zero_pool::zp_task_params;

zp_task_params! {
    MyTask {
        input: u64,
        iterations: usize,
        result: *mut u64,
    }
}

let mut result = 0u64;
let task = MyTask::new(42, 1000, &mut result);