diff options
| author | Weicao-CatilGrass <1992414357@qq.com> | 2026-05-18 12:18:49 +0800 |
|---|---|---|
| committer | Weicao-CatilGrass <1992414357@qq.com> | 2026-05-18 12:18:49 +0800 |
| commit | 7bd2dea88c34957122aa640de42f6bba88f5734e (patch) | |
| tree | 54027aa3ec962dd6fbff82e9e526208cba2f37a3 /mingling_core/src/program/exec | |
| parent | 287d45e32b9bdeaaf58b70ebb9a27335f74c529d (diff) | |
Add documentation comments to chain and error enums
Diffstat (limited to 'mingling_core/src/program/exec')
| -rw-r--r-- | mingling_core/src/program/exec/error.rs | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/mingling_core/src/program/exec/error.rs b/mingling_core/src/program/exec/error.rs index 2790a7b..24112e1 100644 --- a/mingling_core/src/program/exec/error.rs +++ b/mingling_core/src/program/exec/error.rs @@ -1,11 +1,23 @@ use crate::error::{ChainProcessError, ProgramPanic}; use std::fmt; +/// Errors that can occur during program execution. +/// +/// This enum represents the various error conditions that may arise +/// when executing a program, including missing dispatchers/renderers, +/// panics, and other miscellaneous errors. #[derive(Debug)] pub enum ProgramExecuteError { + /// No dispatcher was found to handle the program execution. DispatcherNotFound, + + /// No renderer was found for the given name. RendererNotFound(String), + + /// The program encountered a panic during execution. Panic(ProgramPanic), + + /// An other error occurred. Other(String), } @@ -30,11 +42,25 @@ impl From<ProgramPanic> for ProgramExecuteError { } } +/// Errors that can occur during internal program execution. +/// +/// This enum represents error conditions that arise specifically within +/// the internal execution pipeline of a program, including missing +/// dispatchers/renderers, I/O errors, and other miscellaneous failures. +/// These errors are typically not exposed directly to the end user but +/// are used internally and can be converted into [`ProgramExecuteError`]. #[derive(Debug)] pub enum ProgramInternalExecuteError { + /// No dispatcher was found to handle the program execution. DispatcherNotFound, + + /// No renderer was found for the given name. RendererNotFound(String), + + /// An other internal error occurred. Other(String), + + /// An I/O error occurred during execution. IO(std::io::Error), } |
