Struct egui::any::TypeMap [−][src]
pub struct TypeMap(_);
Maps types to a single instance of that type.
Used to store state per widget type. In effect a sort of singleton storage.
Similar to the typemap
crate.
Implementations
impl TypeMap
[src]
impl TypeMap
[src]pub fn get<T: AnyMapTrait>(&mut self) -> Option<&T>
[src]
pub fn get_mut<T: AnyMapTrait>(&mut self) -> Option<&mut T>
[src]
impl TypeMap
[src]
impl TypeMap
[src]pub fn get_or_insert_with<T: AnyMapTrait>(
&mut self,
or_insert_with: impl FnOnce() -> T
) -> &T
[src]
&mut self,
or_insert_with: impl FnOnce() -> T
) -> &T
pub fn get_or_default<T: AnyMapTrait + Default>(&mut self) -> &T
[src]
pub fn get_mut_or_insert_with<T: AnyMapTrait>(
&mut self,
or_insert_with: impl FnOnce() -> T
) -> &mut T
[src]
&mut self,
or_insert_with: impl FnOnce() -> T
) -> &mut T
pub fn get_mut_or_default<T: AnyMapTrait + Default>(&mut self) -> &mut T
[src]
impl TypeMap
[src]
impl TypeMap
[src]pub fn insert<T: AnyMapTrait>(&mut self, element: T)
[src]
pub fn remove<T: AnyMapTrait>(&mut self)
[src]
pub fn clear(&mut self)
[src]
Trait Implementations
Auto Trait Implementations
impl !RefUnwindSafe for TypeMap
impl Send for TypeMap
impl Sync for TypeMap
impl Unpin for TypeMap
impl !UnwindSafe for TypeMap
Blanket Implementations
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]pub fn borrow_mut(&mut self) -> &mut T
[src]
pub fn borrow_mut(&mut self) -> &mut T
[src]Mutably borrows from an owned value. Read more
impl<T> ToOwned for T where
T: Clone,
[src]
impl<T> ToOwned for T where
T: Clone,
[src]type Owned = T
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
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]
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