Skip to main content

Crate euv_macros

Crate euv_macros 

Source
Expand description

euv-macros

Zero-overhead native procedural macros for the cross-platform euv UI framework, compiling declarative view!, style!, var!, watch!, computed!, state!, #[store], #[component], #[event], emit!, on!, and #[euv] directly into arena scene graph operations with span-preserving IDE completion and actionable compile-time diagnostics.

Macros§

computed
Ergonomic memoized derived signal macro with equality short-circuiting.
emit
Dispatches a typed cross-component custom event through EventBus.
on
Subscribes a scope-owned listener to a typed cross-component custom event (on!(MyEvent => |ev| { ... })).
state
Unified reactive state macro for scoped local state and typed app-wide global state.
style
Compile-time style macro compiling declarative newline-separated rules directly into typed Style constructor functions or inline Style expressions.
var
Compile-time design token variable macro generating span-preserving typed const items.
view
Declarative zero-VDOM, zero-context UI construction macro managing Context automatically.
watch
Ergonomic reactive side-effect macro watching one or more signals or a global state type.

Attribute Macros§

component
Attribute macro splitting an impl MyComponent { fn render(&self) -> NodeId { ... } ... } block into clean impl Lifecycle and impl Component blocks.
euv
Unified cross-platform application entry-point attribute macro (#[euv] or #[euv(title = "...", width = 1280, height = 800)]).
event
Attribute macro marking a struct as a typed cross-component CustomEvent with ergonomic ::emit and ::on helpers.
store
Attribute macro turning a struct into a typed app-wide GlobalState store with .provide(), ::use_global(), ::get_global(), ::set_global(), ::update_global(), and ::watch_global().

Derive Macros§

Props
Derive macro implementing ComponentProps and span-preserving fluent named-prop setters for view! { MyComp { prop: value } }.