aboutsummaryrefslogtreecommitdiff
path: root/mingling_core
diff options
context:
space:
mode:
author魏曹先生 <1992414357@qq.com>2026-06-06 23:16:51 +0800
committer魏曹先生 <1992414357@qq.com>2026-06-06 23:16:51 +0800
commit81635b93c597b10282cb14e0873f5e3d22395186 (patch)
tree200fd2632653fefe751ab5bfa6ebc7a8d4161638 /mingling_core
parenta16d1e6f204cc83104ad3dcc4f4266e304214044 (diff)
Rename `ExitCode` to `ResExitCode` and `REPL` to `ResREPL`
Diffstat (limited to 'mingling_core')
-rw-r--r--mingling_core/src/lib.rs6
-rw-r--r--mingling_core/src/program.rs5
-rw-r--r--mingling_core/src/program/repl_exec.rs10
-rw-r--r--mingling_core/src/program/repl_exec/res.rs2
4 files changed, 14 insertions, 9 deletions
diff --git a/mingling_core/src/lib.rs b/mingling_core/src/lib.rs
index 373df52..6e1e90c 100644
--- a/mingling_core/src/lib.rs
+++ b/mingling_core/src/lib.rs
@@ -70,3 +70,9 @@ pub use crate::comp::*;
pub mod setup {
pub use crate::program::setup::ProgramSetup;
}
+
+#[doc(hidden)]
+pub mod core_res {
+ #[cfg(feature = "repl")]
+ pub use crate::program::repl_exec::res::ResREPL;
+}
diff --git a/mingling_core/src/program.rs b/mingling_core/src/program.rs
index 2e861e4..096f292 100644
--- a/mingling_core/src/program.rs
+++ b/mingling_core/src/program.rs
@@ -25,9 +25,8 @@ pub use collection::*;
mod once_exec;
#[cfg(feature = "repl")]
-mod repl_exec;
-#[cfg(feature = "repl")]
-pub use repl_exec::res::REPL;
+#[doc(hidden)]
+pub mod repl_exec;
mod single_instance;
pub use single_instance::*;
diff --git a/mingling_core/src/program/repl_exec.rs b/mingling_core/src/program/repl_exec.rs
index 033c5a3..d6b3f00 100644
--- a/mingling_core/src/program/repl_exec.rs
+++ b/mingling_core/src/program/repl_exec.rs
@@ -11,7 +11,7 @@ mod splitter;
use crate::error::{ProgramInternalExecuteError, ProgramPanic};
use crate::program::repl_exec::splitter::split_input_string;
use crate::{Program, ProgramCollect, RenderResult};
-use crate::{program::repl_exec::res::REPL, this};
+use crate::{program::repl_exec::res::ResREPL, this};
#[cfg(not(feature = "async"))]
impl<C> Program<C>
@@ -24,7 +24,7 @@ where
/// and displays the execution result or error message. It is suitable for scenarios requiring command-line interaction with the user.
pub fn exec_repl(mut self) {
// Inject default REPL resource
- self.with_resource(REPL::default());
+ self.with_resource(ResREPL::default());
self.run_hook_repl_on_begin();
@@ -48,7 +48,7 @@ where
}
p.run_hook_repl_post_exec();
- if this::<C>().res::<REPL>().unwrap().exit {
+ if this::<C>().res::<ResREPL>().unwrap().exit {
p.run_hook_repl_exit();
break;
}
@@ -73,7 +73,7 @@ where
/// Any panics during command execution will result in an abort rather than being caught and handled gracefully.
pub async fn exec_repl(mut self) {
// Inject default REPL resource
- self.with_resource(REPL::default());
+ self.with_resource(ResREPL::default());
self.run_hook_repl_on_begin();
@@ -94,7 +94,7 @@ where
}
p.run_hook_repl_post_exec();
- if this::<C>().res::<REPL>().unwrap().exit {
+ if this::<C>().res::<ResREPL>().unwrap().exit {
p.run_hook_repl_exit();
break;
}
diff --git a/mingling_core/src/program/repl_exec/res.rs b/mingling_core/src/program/repl_exec/res.rs
index 1295652..53e82d8 100644
--- a/mingling_core/src/program/repl_exec/res.rs
+++ b/mingling_core/src/program/repl_exec/res.rs
@@ -1,6 +1,6 @@
/// Internal resource for the REPL runtime, used to control the REPL's state during execution
#[derive(Default, Clone)]
-pub struct REPL {
+pub struct ResREPL {
/// Marks whether the REPL should exit after the current loop ends
pub exit: bool,
}