arkhe-macros 0.13.0

Derive macros for ArkheKernel: ArkheAction / ArkheComponent / ArkheEvent. Companion crate to arkhe-kernel.
Documentation
  • Coverage
  • 100%
    4 out of 4 items documented0 out of 3 items with examples
  • Size
  • Source code size: 11.88 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 295.27 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 10s Average build duration of successful builds.
  • all releases: 10s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • Homepage
  • aceamro/ArkheKernel
    1 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • aceamro

arkhe-macros

L0 derive macros for arkhe-kernel.

Three procedural derives, one shared shape. Pair the derive with serde::{Serialize, Deserialize}; the kernel provides canonical postcard encoding by default.

Layer

Companion proc-macro crate for the L0 kernel. Not intended for direct use outside of kernel consumers — the derives resolve paths inside ::arkhe_kernel::state::traits::*.

Derives

  • #[derive(ArkheAction)] — emits Sealed + ActionDeriv. Pair with a hand-written impl ActionCompute for T; the kernel supplies the canonical_bytes / from_bytes / approx_size blanket.
  • #[derive(ArkheComponent)] — emits Sealed + Component. No user method required beyond serde derives.
  • #[derive(ArkheEvent)] — same shape as Component; requires Debug + serde.

Every derive expects #[arkhe(type_code = N, schema_version = M)]. schema_version defaults to 1; type_code is mandatory.

Quick start

use arkhe_kernel::{ArkheComponent, ArkheEvent};
use serde::{Serialize, Deserialize};

#[derive(Serialize, Deserialize, ArkheComponent)]
#[arkhe(type_code = 5001, schema_version = 1)]
struct CounterComponent { value: u64 }

#[derive(Debug, Serialize, Deserialize, ArkheEvent)]
#[arkhe(type_code = 8001)]
struct PostCreatedEvent { author: u64, body: String }

Documentation

License

Dual-licensed under MIT OR Apache-2.0 at your option.