Struct egui::any::serializable::TypeMap [−][src]
pub struct TypeMap(_);
Expand description
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 but allows serialization.
Implementations
pub fn get_or_insert_with<T: AnyMapTrait>(
&mut self,
or_insert_with: impl FnOnce() -> T
) -> &T
pub fn get_mut_or_insert_with<T: AnyMapTrait>(
&mut self,
or_insert_with: impl FnOnce() -> T
) -> &mut T
Trait Implementations
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations
impl !RefUnwindSafe for TypeMap
impl !UnwindSafe for TypeMap
Blanket Implementations
Mutably borrows from an owned value. Read more