bernardo-tui 0.2.7

A keyboard-only, distraction-free TUI widget library
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
use crate::widget::any_msg::AnyMsg;
use crate::widget::widget::Widget;

pub struct ActionTrigger<W: Widget> {
    title: String,
    trigger: Box<dyn FnOnce(&W) -> Option<Box<dyn AnyMsg>>>,
}

impl<W: Widget> ActionTrigger<W> {
    pub fn new(title: String, trigger: Box<dyn FnOnce(&W) -> Option<Box<dyn AnyMsg>>>) -> Self {
        ActionTrigger { title, trigger }
    }
}