native-theme-derive
This is an internal implementation detail of
native-theme. You should not depend on this crate directly. Its only purpose is to provide the#[derive(ThemeWidget)]and#[theme_inherit]proc-macros used bynative-theme's own widget types. Addnative-themeas your dependency instead — the macros are applied internally and do not appear in the public API surface you consume.
What it does
Generates, from a single annotated struct definition:
- A paired
Option/Resolvedstruct hierarchy (sparse source vs. fully populated output) merge()logic for overlay composition- Range and presence validation
- Field-level inheritance rules wired into the resolution pipeline
Also provides #[theme_inherit] — a codegen attribute for border/font
inheritance rules previously written by hand across the crate.
Links
- API reference on docs.rs — for
native-thememaintainers only - Main crate:
native-theme
License
Licensed under any of
at your option.