summaryrefslogtreecommitdiff
path: root/mingling/src
diff options
context:
space:
mode:
Diffstat (limited to 'mingling/src')
-rw-r--r--mingling/src/program/exec.rs6
-rw-r--r--mingling/src/program/hint.rs22
2 files changed, 4 insertions, 24 deletions
diff --git a/mingling/src/program/exec.rs b/mingling/src/program/exec.rs
index ccdb17b..8277f69 100644
--- a/mingling/src/program/exec.rs
+++ b/mingling/src/program/exec.rs
@@ -3,7 +3,7 @@
use crate::{
AnyOutput, ChainProcess, Dispatcher, Program, ProgramCollect, RenderResult,
error::{ChainProcessError, ProgramInternalExecuteError},
- hint::{DispatcherNotFound, NoChainFound, ProgramEnd, RendererNotFound},
+ hint::{DispatcherNotFound, RendererNotFound},
};
pub mod error;
@@ -59,7 +59,9 @@ pub async fn exec<C: ProgramCollect>(
}
}
};
- if current.is::<ProgramEnd>() || current.is::<NoChainFound>() {
+
+ // If the dispatcher cannot find the next chain, end execution
+ if C::has_chain(&current) {
break;
}
}
diff --git a/mingling/src/program/hint.rs b/mingling/src/program/hint.rs
index f8eb01e..1e93367 100644
--- a/mingling/src/program/hint.rs
+++ b/mingling/src/program/hint.rs
@@ -1,27 +1,5 @@
use crate::{AnyOutput, ChainProcess, Dispatcher, Node};
-/// Marker: Program End
-///
-/// If a chain outputs ProgramEnd to the Chain,
-/// the program will terminate directly.
-///
-/// You can implement Renderer for ProgramEnd
-/// to render relevant information after the program ends.
-#[cfg_attr(feature = "serde_renderer", derive(serde::Serialize))]
-pub struct ProgramEnd;
-
-/// Marker: Chain Not Found
-///
-/// If a Chain or Dispatcher outputs NoChainFound to the Chain,
-/// the program will terminate directly.
-///
-/// You can implement Renderer for NoChainFound
-/// to render relevant information when a Chain cannot be found.
-#[cfg_attr(feature = "serde_renderer", derive(serde::Serialize))]
-pub struct NoChainFound {
- pub name: String,
-}
-
/// Marker: Dispatcher Not Found
///
/// If a Dispatcher outputs NoDispatcherFound to the Chain,