pub trait Widget {
// Required method
fn update(&mut self) -> Option<WidgetUpdate>;
}Expand description
The trait for an widget.
A widget maintains a dynamic block on the i3bar
Required Methods§
Sourcefn update(&mut self) -> Option<WidgetUpdate>
fn update(&mut self) -> Option<WidgetUpdate>
The function used to update the widget.
Note: even with no update, the widget should return an non-empty update with empty data payload. If None is returned, the framework will disable this widget and do not call the update function anymore.