Trait bones_framework::render::ui::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.

Object Safety§

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§