From 0b06f54103490e3ce5658e82bbc0119633e26cd8 Mon Sep 17 00:00:00 2001 From: nsfisis Date: Fri, 22 May 2026 01:29:48 +0900 Subject: refactor(composer): unify Composer/PartialComposer via Rc handles Model PHP's `Composer extends PartialComposer` as a PartialOrFullComposer enum and merge partial_composer.rs into composer.rs. Introduce ComposerHandle / PartialComposerHandle (plus their Weak variants) so the graph can be shared, and build it at once with Rc::new_cyclic in the factory to resolve the back-reference cycles. Co-Authored-By: Claude Opus 4.7 (1M context) --- crates/shirabe/src/plugin/plugin_interface.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'crates/shirabe/src/plugin/plugin_interface.rs') diff --git a/crates/shirabe/src/plugin/plugin_interface.rs b/crates/shirabe/src/plugin/plugin_interface.rs index 875976f..ae5e3b6 100644 --- a/crates/shirabe/src/plugin/plugin_interface.rs +++ b/crates/shirabe/src/plugin/plugin_interface.rs @@ -1,17 +1,17 @@ //! ref: composer/src/Composer/Plugin/PluginInterface.php -use crate::composer::Composer; +use crate::composer::ComposerHandle; use crate::io::IOInterface; use crate::plugin::Capable; pub const PLUGIN_API_VERSION: &'static str = "2.9.0"; pub trait PluginInterface: std::fmt::Debug { - fn activate(&mut self, composer: &Composer, io: &dyn IOInterface); + fn activate(&mut self, composer: &ComposerHandle, io: &dyn IOInterface); - fn deactivate(&mut self, composer: &Composer, io: &dyn IOInterface); + fn deactivate(&mut self, composer: &ComposerHandle, io: &dyn IOInterface); - fn uninstall(&mut self, composer: &Composer, io: &dyn IOInterface); + fn uninstall(&mut self, composer: &ComposerHandle, io: &dyn IOInterface); fn clone_box(&self) -> Box { todo!() -- cgit v1.3.1