Skip to main content

Crate vaultdb_orm_macros

Crate vaultdb_orm_macros 

Source
Expand description

Proc-macro support for vaultdb-orm.

#[derive(Note)] reads #[note(...)] attributes on the struct and emits:

  • An impl vaultdb_orm::Note block (folder + optional discriminator).
  • One pub fn <field>() accessor per struct field, each returning a FieldRef bound to the underlying frontmatter key. The key honours #[serde(rename = "...")] so model authors can map onto virtual fields like _name without writing it twice.

Supported struct-level keys:

  • #[note(folder = "...")] (required) — the vault folder for this model.
  • #[note(filter = "...")] (optional) — a where-DSL filter parsed at runtime and applied as the discriminator.

Field-level #[note(...)] attributes are reserved for later phases (e.g. #[note(wikilink)] in Phase 5) — for now, the presence of any #[note(...)] attribute on a field suppresses the accessor so the syntax stays free for future use.

Derive Macros§

Note