1# @ajax/mesh-abi-words
23Word and byte access to the mailbox at mailbox offsets: the interface pipes run over.
45Part of the mesh contract: the memory, control, snapshot and peer protocols shared by meshd, its GPU
6programs (CUDA kernels, wasm lanes, native workers) and the tools. Every side compiles the same
7definitions, so an offset can never disagree.
89```c
10#include "mesh/abi/words.h"
11```
1213## Ported from
1415[alpha-rust-mesh](https://github.com/rsafier/alpha-rust-mesh) (Richard Safier, MIT): crates/mesh-abi/src/v2/pipe.rs (the Words and Bytes traits).
1617## Device code
1819The header is freestanding (`<stdint.h>`, `<stddef.h>`, `<stdbool.h>`, `<stdatomic.h>` only): it compiles for the host, `nvptx64-nvidia-cuda` and `wasm32`. Functions the Rust marks `const fn` are `static inline` here.
2021## Tests
2223- none of its own: it is exercised by the packages that use it
2425## Differences
2627Rust's `Words`/`Bytes` traits are a table of function pointers here (`mesh_words`). A missing `fence` means `atomic_thread_fence(memory_order_seq_cst)`, the trait's default. `core::hint::spin_loop()` has no C equivalent and is left out (the loops are bounded by TRIES either way).
2829## Licence
3031MIT. See the repository's LICENSE.