action/
action.rs

1use rui::*;
2
3struct MyAction {}
4
5fn main() {
6    rui(vstack((
7        rectangle()
8            .tap(|_| {
9                println!("rect tapped");
10                MyAction {}
11            })
12            .padding(Auto),
13        text("tap the rectangle to send an action"),
14    ))
15    .handle(|_, _: &MyAction| println!("action received")));
16}