zp_write_indexed

Macro zp_write_indexed 

Source
macro_rules! zp_write_indexed {
    ($collection_ptr:expr, $index:expr, $value:expr) => { ... };
}
Expand description

Write a value to a specific index in a collection via raw pointer

This macro eliminates explicit unsafe blocks when writing to indexed collections.

ยงExamples

use zero_pool::{zp_write_indexed, zp_define_task_fn, zp_task_params};

zp_task_params! {
    BatchTask { index: usize, results: *mut Vec<u64> }
}

zp_define_task_fn!(batch_task, BatchTask, |params| {
    let sum = 42u64;
    zp_write_indexed!(params.results, params.index, sum);
});