pub struct UiTags(pub HashMap<String, Option<Arc<dyn Any + Send + Sync + 'static>>>);
Expand description
User-chosen tags.
You can use this in any way you want,
i.e. to set some tag on a crate::Ui
and then in your own widget check
for the existence of this tag up the UiStack
.
Note that egui never sets any tags itself, so this is purely for user code.
All tagging is transient, and will only live as long as the parent crate::Ui
, i.e. within a single render frame.
Tuple Fields§
§0: HashMap<String, Option<Arc<dyn Any + Send + Sync + 'static>>>
Implementations§
source§impl UiTags
impl UiTags
pub fn insert( &mut self, key: impl Into<String>, value: Option<Arc<dyn Any + Send + Sync + 'static>>, )
pub fn contains(&self, key: &str) -> bool
Trait Implementations§
Auto Trait Implementations§
impl Freeze for UiTags
impl !RefUnwindSafe for UiTags
impl Send for UiTags
impl Sync for UiTags
impl Unpin for UiTags
impl !UnwindSafe for UiTags
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)