EguiContextExt

Trait EguiContextExt 

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

Source

fn clear_focus(self)

Clear the UI focus

Source

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.

Source

fn set_state<T: Clone + Default + Sync + Send + 'static>(self, value: T)

Set a global runtime state from the EGUI context.

This is just a convenience wrapper around Egui’s built in temporary data store.

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.

Implementations on Foreign Types§

Source§

impl EguiContextExt for &Context

Source§

fn clear_focus(self)

Source§

fn get_state<T: Clone + Default + Sync + Send + 'static>(self) -> T

Source§

fn set_state<T: Clone + Default + Sync + Send + 'static>(self, value: T)

Implementors§