Enum agui_core::unit::Key [−][src]
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
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Key
impl UnwindSafe for Key
Blanket Implementations
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