pub trait UiExt {
// Required methods
fn popup_error(&self, error: &str) -> bool;
fn popup_notify(&self, info: &str) -> bool;
fn refresh_button<T, E, Fut>(
&mut self,
bind: &mut Bind<T, E>,
f: impl FnOnce() -> Fut,
secs: f64,
)
where Fut: Future<Output = Result<T, E>> + MaybeSend + 'static,
T: MaybeSend + 'static,
E: MaybeSend + 'static;
}
Expand description
Extension trait for egui::Ui
providing convenient UI widgets.
Required Methods§
Sourcefn popup_error(&self, error: &str) -> bool
fn popup_error(&self, error: &str) -> bool
Pops up an error window with the given error message.
§Returns
true
if the “Retry” button was clicked.
Sourcefn popup_notify(&self, info: &str) -> bool
fn popup_notify(&self, info: &str) -> bool
Pops up a notification window with the given info message.
§Returns
true
if the “Ok” button was clicked.
Adds a refresh button that triggers a new future when clicked.
This widget also handles periodic refreshing.
The button shows a tooltip with the time remaining until the next automatic refresh.
If the button is clicked, it triggers an immediate refresh, unless the last refresh
was less than secs / 4.0
seconds ago to prevent spamming.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.