Enum agui_core::unit::Key[][src]

pub enum Key {
    Unique(u64),
    Local(u64),
    Global(u64),
}
Expand description

The key used for caching a widget.

This is used as a cache key for retaining a widget across rebuilds. The u64 within it must be unique within the scope indicated by the variant, or a panic! will occur.

In order for a widget to be persisted across rebuilds, it must be destroyed and recreated in a single frame, it cannot be delayed or the old state will be lost.

Variants

Unique(u64)

Tuple Fields

0: u64

A unique key.

This should generally be created “above” the widget that uses it as a key, because it’s created anew each time.

Local(u64)

Tuple Fields

0: u64

A local key.

This should be unique within a widget’s build() method. Any widget with the same key across rebuilds will be cached and re-parented, instead of rebuilt.

Global(u64)

Tuple Fields

0: u64

A global key.

This should be unique throughout the entire system.

Implementations

A helper function to cache a single Local widget.

Creates a Unique key.

Create a Local key based on the value.

Create a Global key based on the value.

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

Feeds this value into the given Hasher. Read more

Feeds a slice of this type into the given Hasher. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

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

Convert Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can then be further downcast into Box<ConcreteType> where ConcreteType implements Trait. Read more

Convert Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be further downcast into Rc<ConcreteType> where ConcreteType implements Trait. Read more

Convert &Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &Any’s vtable from &Trait’s. Read more

Convert &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s. Read more

Convert Arc<Trait> (where Trait: Downcast) to Arc<Any>. Arc<Any> can then be further downcast into Arc<ConcreteType> where ConcreteType implements Trait. 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)

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.