memmap3-macros

Crates.iomemmap3-macros
lib.rsmemmap3-macros
version0.1.0
created_at2025-09-27 20:55:10.098917+00
updated_at2025-09-27 20:55:10.098917+00
descriptionProcedural macros for memmap3
homepage
repositoryhttps://gitlab.com/deepbrainspace/memmap3
max_upload_size
id1857682
size49,085
nayeem.ai (wizardsupreme)

documentation

README

memmap3-macros

Crates.io docs.rs

Procedural macros for the memmap3 crate.

⚠️ Note for Users

You should not install this crate directly. This crate contains the procedural macros used by memmap3 and is automatically included when you add memmap3 to your dependencies.

Installation

Add memmap3 to your Cargo.toml (not this crate):

[dependencies]
memmap3 = "0.1"

What This Crate Provides

This crate implements the #[mmap_struct] attribute macro that transforms regular Rust structs into memory-mappable types:

use memmap3::prelude::*;

#[mmap_struct]  // <- This macro is provided by memmap3-macros
struct Config {
    #[mmap(atomic)]
    counter: u64,
    name: [u8; 32],
}

The macro automatically:

  • Adds #[repr(C)] for predictable memory layout
  • Transforms atomic fields (e.g., u64 with #[mmap(atomic)] becomes MmapAtomicU64)
  • Auto-detects byte arrays as strings (unless marked with #[mmap(raw)])
  • Generates the StructLayout trait implementation

Documentation

For complete documentation and examples, see the main memmap3 crate.

License

This project is licensed under the MIT OR Apache-2.0 license.

Commit count: 0

cargo fmt