diff options
| author | nsfisis <nsfisis@gmail.com> | 2026-05-17 16:26:19 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2026-05-17 16:27:24 +0900 |
| commit | cb2adb32c90b4150c96518ec5be152be70bcb792 (patch) | |
| tree | 053c3309975565133ccca156c876dcf4227ffe8e /crates/shirabe/src/io/io_interface.rs | |
| parent | 62c827a7b858796a7f51de3eeff1d6c56c3afe7b (diff) | |
| download | php-shirabe-cb2adb32c90b4150c96518ec5be152be70bcb792.tar.gz php-shirabe-cb2adb32c90b4150c96518ec5be152be70bcb792.tar.zst php-shirabe-cb2adb32c90b4150c96518ec5be152be70bcb792.zip | |
fix(compile): fix IOInterface method signature mismatches
- Change write/write_error/write_raw/write_error_raw/overwrite/
overwrite_error/ask/ask_confirmation/ask_and_validate/
ask_and_hide_answer/select to &mut self in trait and NullIO
- Change ask-family question params from PhpMixed to String in
ConsoleIO, converting to PhpMixed::String internally
- Change ConsoleIO::select choices param from PhpMixed to Vec<String>
- Fix NullIO::load_configuration to use &mut Config and return Result
Diffstat (limited to 'crates/shirabe/src/io/io_interface.rs')
| -rw-r--r-- | crates/shirabe/src/io/io_interface.rs | 28 |
1 files changed, 17 insertions, 11 deletions
diff --git a/crates/shirabe/src/io/io_interface.rs b/crates/shirabe/src/io/io_interface.rs index 406a3ff..3826bb3 100644 --- a/crates/shirabe/src/io/io_interface.rs +++ b/crates/shirabe/src/io/io_interface.rs @@ -22,34 +22,40 @@ pub trait IOInterface: LoggerInterface { fn is_decorated(&self) -> bool; - fn write(&self, messages: PhpMixed, newline: bool, verbosity: i64); + fn write(&mut self, messages: PhpMixed, newline: bool, verbosity: i64); - fn write_error(&self, messages: PhpMixed, newline: bool, verbosity: i64); + fn write_error(&mut self, messages: PhpMixed, newline: bool, verbosity: i64); - fn write_raw(&self, messages: PhpMixed, newline: bool, verbosity: i64); + fn write_raw(&mut self, messages: PhpMixed, newline: bool, verbosity: i64); - fn write_error_raw(&self, messages: PhpMixed, newline: bool, verbosity: i64); + fn write_error_raw(&mut self, messages: PhpMixed, newline: bool, verbosity: i64); - fn overwrite(&self, messages: PhpMixed, newline: bool, size: Option<i64>, verbosity: i64); + fn overwrite(&mut self, messages: PhpMixed, newline: bool, size: Option<i64>, verbosity: i64); - fn overwrite_error(&self, messages: PhpMixed, newline: bool, size: Option<i64>, verbosity: i64); + fn overwrite_error( + &mut self, + messages: PhpMixed, + newline: bool, + size: Option<i64>, + verbosity: i64, + ); - fn ask(&self, question: String, default: PhpMixed) -> PhpMixed; + fn ask(&mut self, question: String, default: PhpMixed) -> PhpMixed; - fn ask_confirmation(&self, question: String, default: bool) -> bool; + fn ask_confirmation(&mut self, question: String, default: bool) -> bool; fn ask_and_validate( - &self, + &mut self, question: String, validator: Box<dyn Fn(PhpMixed) -> PhpMixed>, attempts: Option<i64>, default: PhpMixed, ) -> PhpMixed; - fn ask_and_hide_answer(&self, question: String) -> Option<String>; + fn ask_and_hide_answer(&mut self, question: String) -> Option<String>; fn select( - &self, + &mut self, question: String, choices: Vec<String>, default: PhpMixed, |
