Crate ribir_macros

source ·

Macros§

  • The ctx! macro is a special name that use to share the BuildCtx between macros.
  • 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.
  • macro map a write to another state write. For example, map_writer!($label.visible); will return a writer of bool that is partial of the Visibility. This macros is a convenient way for StateWriter::map_writer
  • 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.
  • 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!().
  • This macro just return the input token stream. It’s do nothing but help ribir mark that a macro has been expanded.
  • macro split a new writer from a state writer. For example, split_writer!($label.visible); will return a writer of bool that is partial of the Visibility. This macros is a convenient way for StateWriter::split_writer
  • watch! macro use to convert a expression to a Observable stream. Use the $ mark the state reference and auto subscribe to its modify.

Derive Macros§