aboutsummaryrefslogtreecommitdiffhomepage
path: root/crates/shirabe/src/installer/installer_event.rs
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2026-05-26 20:04:02 +0900
committernsfisis <nsfisis@gmail.com>2026-05-26 20:04:02 +0900
commitf411daceacad66e0bd774fda7d3c5ef8533cc55c (patch)
treeeefb065e4d676a3f7031ca49bab21c773b00b134 /crates/shirabe/src/installer/installer_event.rs
parent1921f173ea219cb4b25847294d2d3fa465550fbb (diff)
downloadphp-shirabe-f411daceacad66e0bd774fda7d3c5ef8533cc55c.tar.gz
php-shirabe-f411daceacad66e0bd774fda7d3c5ef8533cc55c.tar.zst
php-shirabe-f411daceacad66e0bd774fda7d3c5ef8533cc55c.zip
refactor(io): share IOInterface via Rc<RefCell<dyn _>> handle
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Diffstat (limited to 'crates/shirabe/src/installer/installer_event.rs')
-rw-r--r--crates/shirabe/src/installer/installer_event.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/crates/shirabe/src/installer/installer_event.rs b/crates/shirabe/src/installer/installer_event.rs
index 3c02b7f..5adde1c 100644
--- a/crates/shirabe/src/installer/installer_event.rs
+++ b/crates/shirabe/src/installer/installer_event.rs
@@ -9,7 +9,7 @@ use crate::io::IOInterface;
pub struct InstallerEvent {
inner: Event,
composer: ComposerWeakHandle,
- io: Box<dyn IOInterface>,
+ io: std::rc::Rc<std::cell::RefCell<dyn IOInterface>>,
dev_mode: bool,
execute_operations: bool,
transaction: Transaction,
@@ -19,7 +19,7 @@ impl InstallerEvent {
pub fn new(
event_name: String,
composer: ComposerWeakHandle,
- io: Box<dyn IOInterface>,
+ io: std::rc::Rc<std::cell::RefCell<dyn IOInterface>>,
dev_mode: bool,
execute_operations: bool,
transaction: Transaction,
@@ -39,8 +39,8 @@ impl InstallerEvent {
&self.composer
}
- pub fn get_io(&self) -> &dyn IOInterface {
- self.io.as_ref()
+ pub fn get_io(&self) -> std::rc::Rc<std::cell::RefCell<dyn IOInterface>> {
+ self.io.clone()
}
pub fn is_dev_mode(&self) -> bool {