Struct egui::Memory[][src]

pub struct Memory {
    pub options: Options,
    pub data: TypeMap,
    pub data_temp: TypeMap,
    pub id_data: AnyMap<Id>,
    pub id_data_temp: AnyMap<Id>,
    // some fields omitted
}

The data that egui persists between frames.

This includes window positions and sizes, how far the user has scrolled in a ScrollArea etc.

If you want this to persist when closing your app you should serialize Memory and store it.

If you want to store data for your widgets, you should look at data/data_temp and id_data/id_data_temp fields, and read the documentation of any module.

Fields

options: Optionsdata: TypeMap

This map stores current states for widgets that don’t require Id. This will be saved between different program runs if you use the persistence feature.

data_temp: TypeMap

Same as data, but this data will not be saved between runs.

id_data: AnyMap<Id>

This map stores current states for all widgets with custom Ids. This will be saved between different program runs if you use the persistence feature.

id_data_temp: AnyMap<Id>

Same as id_data, but this data will not be saved between runs.

Implementations

impl Memory[src]

pub fn layer_id_at(
    &self,
    pos: Pos2,
    resize_interact_radius_side: f32
) -> Option<LayerId>
[src]

pub fn has_focus(&self, id: Id) -> bool[src]

Does this widget have keyboard focus?

pub fn request_focus(&mut self, id: Id)[src]

Give keyboard focus to a specific widget. See also crate::Response::request_focus.

pub fn surrender_focus(&mut self, id: Id)[src]

Surrender keyboard focus for a specific widget. See also crate::Response::surrender_focus.

pub fn stop_text_input(&mut self)[src]

Stop editing of active TextEdit (if any).

pub fn is_anything_being_dragged(&self) -> bool[src]

pub fn is_being_dragged(&self, id: Id) -> bool[src]

pub fn reset_areas(&mut self)[src]

Forget window positions, sizes etc. Can be used to auto-layout windows.

impl Memory[src]

Popups

Popups are things like combo-boxes, color pickers, menus etc. Only one can be be open at a time.

pub fn is_popup_open(&mut self, popup_id: Id) -> bool[src]

pub fn open_popup(&mut self, popup_id: Id)[src]

pub fn close_popup(&mut self)[src]

pub fn toggle_popup(&mut self, popup_id: Id)[src]

pub fn everything_is_visible(&self) -> bool[src]

If true, all windows, menus, tooltips etc are to be visible at once.

This is useful for testing, benchmarking, pre-caching, etc.

Experimental feature!

pub fn set_everything_is_visible(&mut self, value: bool)[src]

If true, all windows, menus, tooltips etc are to be visible at once.

This is useful for testing, benchmarking, pre-caching, etc.

Experimental feature!

Trait Implementations

impl Clone for Memory[src]

fn clone(&self) -> Memory[src]

Returns a copy of the value. Read more

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl Debug for Memory[src]

fn fmt(&self, f: &mut Formatter<'_>) -> Result[src]

Formats the value using the given formatter. Read more

impl Default for Memory[src]

fn default() -> Memory[src]

Returns the “default value” for a type. Read more

Auto Trait Implementations

impl !RefUnwindSafe for Memory

impl Send for Memory

impl Sync for Memory

impl Unpin for Memory

impl !UnwindSafe for Memory

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

impl<T> From<T> for T[src]

pub fn from(t: T) -> T[src]

Performs the conversion.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

pub fn into(self) -> U[src]

Performs the conversion.

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

pub fn to_owned(&self) -> T[src]

Creates owned data from borrowed data, usually by cloning. Read more

pub fn clone_into(&self, target: &mut T)[src]

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]

Performs the conversion.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]

Performs the conversion.