1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
/// Offload expensive computation to a rayon thread on native, run inline on WASM.
///
/// On native, the expression is moved into a `rayon::spawn` closure and the result
/// is sent back via a `tokio::sync::oneshot` channel. On WASM (single-threaded),
/// the expression is evaluated inline.
///
/// Must be called from an async context (the native path uses `.await`).
/// The expression must be `Send + 'static` on native (captured by `move` closure).
///
/// ```ignore
/// let root = maybe_rayon!(merkle::sector_root(data.as_ref()));
/// let result = maybe_rayon!(proof.verify(&root, start, end))?;
/// ```
extern crate self as sia_core;