{"record":{"id":"ea06435e03edf7d3","repo":"emilk/egui","slug":"pluginhandle-plugin-is-not-of-the-expected-type","errorCode":null,"errorMessage":"PluginHandle: plugin is not of the expected type","messagePattern":"PluginHandle: plugin is not of the expected type","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/egui/src/plugin.rs","lineNumber":125,"sourceCode":"impl PluginHandle {\n    pub fn new<P: Plugin>(plugin: P) -> Arc<Mutex<Self>> {\n        Arc::new(Mutex::new(Self {\n            plugin: Box::new(plugin),\n        }))\n    }\n\n    fn plugin_type_id(&self) -> core::any::TypeId {\n        (*self.plugin).type_id()\n    }\n\n    pub fn dyn_plugin_mut(&mut self) -> &mut dyn Plugin {\n        &mut *self.plugin\n    }\n\n    fn typed_plugin<P: Plugin + 'static>(&self) -> &P {\n        (self.plugin.as_ref() as &dyn core::any::Any)\n            .downcast_ref::<P>()\n            .expect(\"PluginHandle: plugin is not of the expected type\")\n    }\n\n    pub fn typed_plugin_mut<P: Plugin + 'static>(&mut self) -> &mut P {\n        (self.plugin.as_mut() as &mut dyn core::any::Any)\n            .downcast_mut::<P>()\n            .expect(\"PluginHandle: plugin is not of the expected type\")\n    }\n}\n\n/// User-registered plugins.\n#[derive(Clone, Default)]\npub(crate) struct Plugins {\n    plugins: HashMap<core::any::TypeId, Arc<Mutex<PluginHandle>>>,\n    plugins_ordered: PluginsOrdered,\n}\n\n#[derive(Clone, Default)]\npub(crate) struct PluginsOrdered(Vec<Arc<Mutex<PluginHandle>>>);","sourceCodeStart":107,"sourceCodeEnd":143,"githubUrl":"https://github.com/emilk/egui/blob/d802a982ce959839d92f4f6718fdffa41143110e/crates/egui/src/plugin.rs#L107-L143","documentation":"Error \"PluginHandle: plugin is not of the expected type\" thrown in emilk/egui.","triggerScenarios":"Thrown at crates/egui/src/plugin.rs:125 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"d802a982ce959839d92f4f6718fdffa41143110e","analyzedAt":"2026-08-16T20:07:53.954Z","schemaVersion":2},"datasetVersion":"2026-08-16T23:17:17.608Z"}