diff options
| author | nsfisis <nsfisis@gmail.com> | 2026-05-28 03:31:41 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2026-05-28 03:32:04 +0900 |
| commit | c7f53c5d7d581ebf76803650c63ec615b1558dc8 (patch) | |
| tree | c6d83819e82a83cf93ca737b661094a8ea800cec /crates/shirabe/src/plugin/plugin_interface.rs | |
| parent | cc5d73c05a0abca2eebcc8a6afa0b1543ee49850 (diff) | |
| download | php-shirabe-refactor/composer-handles.tar.gz php-shirabe-refactor/composer-handles.tar.zst php-shirabe-refactor/composer-handles.zip | |
refactor(composer): represent composer via trait-based handlesrefactor/composer-handles
Replace the PartialComposer/Composer structs and the single
Rc<RefCell<PartialOrFullComposer>> enum with PartialComposer and
Composer traits (Composer: PartialComposer), InnerPartialComposer /
InnerFullComposer data structs, and the handle types FullComposerHandle
(impl Composer) and AnyComposerHandle (polymorphic enum, impl
PartialComposer), plus their weak variants.
Factory builds the full and partial graphs via separate Rc::new_cyclic
branches that share a build_composer_base helper. Call sites now use
trait methods that encapsulate borrowing instead of borrow_partial() /
composer_full*().
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Diffstat (limited to 'crates/shirabe/src/plugin/plugin_interface.rs')
| -rw-r--r-- | crates/shirabe/src/plugin/plugin_interface.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/crates/shirabe/src/plugin/plugin_interface.rs b/crates/shirabe/src/plugin/plugin_interface.rs index ae5e3b6..852c69b 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::ComposerHandle; +use crate::composer::FullComposerHandle; 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: &ComposerHandle, io: &dyn IOInterface); + fn activate(&mut self, composer: &FullComposerHandle, io: &dyn IOInterface); - fn deactivate(&mut self, composer: &ComposerHandle, io: &dyn IOInterface); + fn deactivate(&mut self, composer: &FullComposerHandle, io: &dyn IOInterface); - fn uninstall(&mut self, composer: &ComposerHandle, io: &dyn IOInterface); + fn uninstall(&mut self, composer: &FullComposerHandle, io: &dyn IOInterface); fn clone_box(&self) -> Box<dyn PluginInterface> { todo!() |
