Skip to main content

Widget

Trait Widget 

Source
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§

Source

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.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§