Skip to main content

Crate aimdb_derive

Crate aimdb_derive 

Source
Expand description

Derive macros for AimDB record key types

This crate provides the #[derive(RecordKey)] macro for defining compile-time checked record keys with optional connector metadata.

§Example

Illustrative (not compiled: the generated impl targets aimdb_core’s RecordKey trait, a circular dev-dependency for this proc-macro crate — compiled integration tests live in aimdb-core):

ⓘ
use aimdb_derive::RecordKey;

// Note: Hash is auto-generated by the derive macro to satisfy the Borrow<str> contract
#[derive(RecordKey, Clone, Copy, PartialEq, Eq)]
pub enum AppKey {
    #[key = "temp.indoor"]
    #[link_address = "mqtt://sensors/temp/indoor"]
    TempIndoor,

    #[key = "temp.outdoor"]
    #[link_address = "knx://9/1/0"]
    TempOutdoor,
}

Macros§

migration_chain
Variable-arity replacement for aimdb-data-contracts’s old 3-arm macro_rules! migration_chain. Re-exported as aimdb_data_contracts::migration_chain! — see that crate’s migratable feature and migratable.rs for the user-facing grammar and docs.

Derive Macros§

Linkable
Derive Linkable (JSON codec) for a schema type.
RecordKey
Derive the RecordKey trait for an enum