aboutsummaryrefslogtreecommitdiffhomepage
path: root/crates/shirabe/src/installer/installer_interface.rs
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2026-06-05 02:08:55 +0900
committernsfisis <nsfisis@gmail.com>2026-06-05 02:08:55 +0900
commitd59da23db4aeabd1c6807bcddce562e19b645796 (patch)
tree512b8f0b7e102578271c58f7e30f112e8ecbfabf /crates/shirabe/src/installer/installer_interface.rs
parentb62d937331860b5cf17737c9f6be8a015bda102c (diff)
downloadphp-shirabe-d59da23db4aeabd1c6807bcddce562e19b645796.tar.gz
php-shirabe-d59da23db4aeabd1c6807bcddce562e19b645796.tar.zst
php-shirabe-d59da23db4aeabd1c6807bcddce562e19b645796.zip
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 <noreply@anthropic.com>
Diffstat (limited to 'crates/shirabe/src/installer/installer_interface.rs')
-rw-r--r--crates/shirabe/src/installer/installer_interface.rs10
1 files changed, 10 insertions, 0 deletions
diff --git a/crates/shirabe/src/installer/installer_interface.rs b/crates/shirabe/src/installer/installer_interface.rs
index 3056429..20fdb2c 100644
--- a/crates/shirabe/src/installer/installer_interface.rs
+++ b/crates/shirabe/src/installer/installer_interface.rs
@@ -1,5 +1,7 @@
//! ref: composer/src/Composer/Installer/InstallerInterface.php
+use crate::installer::BinaryPresenceInterface;
+use crate::installer::PluginInstaller;
use crate::package::PackageInterfaceHandle;
use crate::repository::InstalledRepositoryInterface;
use shirabe_php_shim::PhpMixed;
@@ -55,6 +57,14 @@ pub trait InstallerInterface: std::fmt::Debug {
fn get_install_path(&self, package: PackageInterfaceHandle) -> Option<String>;
+ fn as_binary_presence_interface(&mut self) -> Option<&mut dyn BinaryPresenceInterface> {
+ None
+ }
+
+ fn as_plugin_installer_mut(&mut self) -> Option<&mut PluginInstaller> {
+ None
+ }
+
fn clone_box(&self) -> Box<dyn InstallerInterface> {
todo!()
}