diff options
| author | nsfisis <nsfisis@gmail.com> | 2026-05-26 20:04:02 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2026-05-26 20:04:02 +0900 |
| commit | f411daceacad66e0bd774fda7d3c5ef8533cc55c (patch) | |
| tree | eefb065e4d676a3f7031ca49bab21c773b00b134 /crates/shirabe/src/script/event.rs | |
| parent | 1921f173ea219cb4b25847294d2d3fa465550fbb (diff) | |
| download | php-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/script/event.rs')
| -rw-r--r-- | crates/shirabe/src/script/event.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/crates/shirabe/src/script/event.rs b/crates/shirabe/src/script/event.rs index 1bd37dd..60557b0 100644 --- a/crates/shirabe/src/script/event.rs +++ b/crates/shirabe/src/script/event.rs @@ -10,7 +10,7 @@ use shirabe_php_shim::PhpMixed; pub struct Event { inner: BaseEvent, composer: ComposerWeakHandle, - io: Box<dyn IOInterface>, + io: std::rc::Rc<std::cell::RefCell<dyn IOInterface>>, dev_mode: bool, originating_event: Option<Box<BaseEvent>>, } @@ -19,7 +19,7 @@ impl Event { pub fn new( name: String, composer: ComposerWeakHandle, - io: Box<dyn IOInterface>, + io: std::rc::Rc<std::cell::RefCell<dyn IOInterface>>, dev_mode: bool, args: Vec<String>, flags: IndexMap<String, PhpMixed>, @@ -37,8 +37,8 @@ impl Event { &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 { |
