pub trait EguiContextExt {
// Required methods
fn clear_focus(self);
fn get_state<T: Clone + Default + Sync + Send + 'static>(self) -> T;
fn set_state<T: Clone + Default + Sync + Send + 'static>(self, value: T);
}Expand description
Extension trait with helpers for the egui context
Required Methods§
Sourcefn clear_focus(self)
fn clear_focus(self)
Clear the UI focus
Sourcefn get_state<T: Clone + Default + Sync + Send + 'static>(self) -> T
fn get_state<T: Clone + Default + Sync + Send + 'static>(self) -> T
Get a global runtime state from the EGUI context, returning the default value if it is not present.
This is just a convenience wrapper around Egui’s built in temporary data store.
The value will be cloned to get it out of the store without holding a lock.
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.