Crate ribir_macros

Source

Macros§

ctx
The ctx! macro is a special name that use to share the BuildCtx between macros.
fn_widget
The fn_widget is a macro that create a widget from a function widget from a expression. Its syntax is extended from rust syntax, you can use @ and $ in the expression, the @ is a short hand of rdl macro, and $name use to expression a state reference of name.
include_crate_svg
Includes an SVG file as an Svg. The file is located relative to the current crate (similar to the location of your cargo.toml). The provided path is interpreted in a platform-specific way at compile time. For example, a Windows path with backslashes \ would not compile correctly on Unix. This macro returns an expression of type Svg.
pipe
pipe macro use to create Pipe object that continuous trace the expression modify. Use the $ mark the state reference and auto subscribe to its modify.
rdl
A macro use to declare an object. This macro will use ctx!() to access the BuildCtx, so it can only use in a scope that has a BuildCtx named as ctx!().
ribir_expanded_ಠ_
This macro just return the input token stream. It’s do nothing but help ribir mark that a macro has been expanded.
watch
The watch! macro converts an expression into an Observable stream. Use $ to mark the state reference, which automatically maps its modifications to the expression value.

Attribute Macros§

simple_declare
Macro attribute implement the Declare trait with that only build a State<T> that not extend any built-in ability, and not support pipe! to init the field.

Derive Macros§

Declare
Macro to implement the Declare trait and build a FatObj<T>. To know how to use it see the declare mod document
Lerp
MultiChild
PairChild
Query
SingleChild
Template