From d59da23db4aeabd1c6807bcddce562e19b645796 Mon Sep 17 00:00:00 2001 From: nsfisis Date: Fri, 5 Jun 2026 02:08:55 +0900 Subject: feat(installer): wire InstallerInterface marker-trait downcasts Add as_binary_presence_interface and as_plugin_installer_mut to InstallerInterface following the downloader marker-trait downcast pattern, so InstallationManager can model the PHP instanceof checks in ensureBinariesPresence and disablePlugins. Make BinaryPresenceInterface take &mut self, resolving LibraryInstaller's stubbed trait impl. Co-Authored-By: Claude Opus 4.8 --- crates/shirabe/src/installer/plugin_installer.rs | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'crates/shirabe/src/installer/plugin_installer.rs') diff --git a/crates/shirabe/src/installer/plugin_installer.rs b/crates/shirabe/src/installer/plugin_installer.rs index 38fcb0d..00b2210 100644 --- a/crates/shirabe/src/installer/plugin_installer.rs +++ b/crates/shirabe/src/installer/plugin_installer.rs @@ -2,6 +2,7 @@ use crate::composer::PartialComposerWeakHandle; use crate::installer::BinaryInstaller; +use crate::installer::BinaryPresenceInterface; use crate::installer::InstallerInterface; use crate::installer::LibraryInstaller; use crate::io::IOInterface; @@ -176,4 +177,12 @@ impl InstallerInterface for PluginInstaller { fn get_install_path(&self, package: PackageInterfaceHandle) -> Option { self.inner.get_install_path(package) } + + fn as_binary_presence_interface(&mut self) -> Option<&mut dyn BinaryPresenceInterface> { + Some(&mut self.inner) + } + + fn as_plugin_installer_mut(&mut self) -> Option<&mut PluginInstaller> { + Some(self) + } } -- cgit v1.3.1