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
}
Expand description

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

Does this widget have keyboard focus?

Which widget has keyboard focus?

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

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

Stop editing of active TextEdit (if any).

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

Popups

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

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

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

Experimental feature!

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

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

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

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

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

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

recently added

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

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.