Expand description
§kael-macros
Procedural macros behind Kael’s action, element, context, style, inspection, and deterministic-test APIs.
Applications should normally depend on kael, which
re-exports the application-facing macros with the runtime traits and types they
generate code against. Direct use of this crate is mainly useful for framework
integrators.
The application-facing entry points are:
#[derive(Action)],#[derive(IntoElement)],#[derive(AppContext)], and#[derive(VisualContext)];#[kael::test]for deterministic framework tests;register_action!for manually implemented action types.
Action names are application protocol keys. The derive rejects empty,
oversized, control-character, and whitespace-padded names, as well as duplicate
deprecated aliases. Context derives require exactly one argument-free #[app]
or #[window] marker on a named field. Deterministic tests require at least one
iteration.
The remaining style and inspector macros generate Kael’s own builder and
reflection APIs. Most applications use the generated methods through
kael::Styled instead of invoking those macros directly.
See the Kael guide and
kael-macros API documentation for the complete
macro reference.
§License
Licensed under the Apache License, Version 2.0.
Macros§
- border_
style_ methods - Generates methods for border styles.
- box_
shadow_ style_ methods - Generates methods for box shadow styles.
- cursor_
style_ methods - Generates methods for cursor styles.
- margin_
style_ methods - Generates methods for margin styles.
- overflow_
style_ methods - Generates methods for overflow styles.
- padding_
style_ methods - Generates methods for padding styles.
- position_
style_ methods - Generates methods for position styles.
- register_
action - Registers an action with the Kael runtime when you manually implement
the
Actiontrait. Typically you should use theActionderive macro oractions!macro instead. - visibility_
style_ methods - Generates methods for visibility styles.
Attribute Macros§
- derive_
inspector_ reflection - When added to a trait,
#[derive_inspector_reflection]generates a module which provides enumeration and lookup by name of all methods that have the shapefn method(self) -> Self. This is used by the inspector so that it can use the builder methods inStyledandStyledExt. - test
#[kael::test]annotates test functions that run with Kael support.
Derive Macros§
- Action
- Derives Kael’s
Actionprotocol implementation for a concrete type. - AppContext
- Derives
AppContextfor a type that holds a&mut App. - Into
Element - Derives
IntoElementfor a type that implementsRenderOnce. - Visual
Context - Derives
VisualContextfor anAppContextthat also holds a&mut Window.