aboutsummaryrefslogtreecommitdiff
path: root/mingling_core/src/program
diff options
context:
space:
mode:
Diffstat (limited to 'mingling_core/src/program')
-rw-r--r--mingling_core/src/program/collection.rs16
-rw-r--r--mingling_core/src/program/collection/mock.rs4
-rw-r--r--mingling_core/src/program/hook.rs4
3 files changed, 16 insertions, 8 deletions
diff --git a/mingling_core/src/program/collection.rs b/mingling_core/src/program/collection.rs
index d5aab4b..14705ac 100644
--- a/mingling_core/src/program/collection.rs
+++ b/mingling_core/src/program/collection.rs
@@ -4,7 +4,7 @@ use std::pin::Pin;
#[cfg(feature = "dispatch_tree")]
use crate::Dispatcher;
-use crate::{AnyOutput, ChainProcess, Groupped, RenderResult};
+use crate::{AnyOutput, ChainProcess, Grouped, RenderResult};
#[cfg(feature = "structural_renderer")]
use crate::{StructuralRendererSetting, error::StructuralRendererSerializeError};
@@ -21,9 +21,17 @@ pub use mock::*;
pub trait ProgramCollect {
/// Enum type representing internal IDs for the program
type Enum;
- type ErrorDispatcherNotFound: Groupped<Self::Enum>;
- type ErrorRendererNotFound: Groupped<Self::Enum>;
- type ResultEmpty: Groupped<Self::Enum>;
+ /// Error type when a dispatcher is not found for the given member
+ type ErrorDispatcherNotFound: Grouped<Self::Enum>;
+
+ /// Error type when a renderer is not found for the given member
+ type ErrorRendererNotFound: Grouped<Self::Enum>;
+
+ /// Result type for an empty chain result
+ ///
+ /// When the `extra_macros` feature is enabled,
+ /// you can use the `empty_result!()` macro to create this
+ type ResultEmpty: Grouped<Self::Enum>;
/// Use a prefix tree to quickly match arguments and dispatch to an Entry
#[cfg(feature = "dispatch_tree")]
diff --git a/mingling_core/src/program/collection/mock.rs b/mingling_core/src/program/collection/mock.rs
index 9b2e7af..5847f10 100644
--- a/mingling_core/src/program/collection/mock.rs
+++ b/mingling_core/src/program/collection/mock.rs
@@ -4,7 +4,7 @@ use std::pin::Pin;
#[cfg(feature = "dispatch_tree")]
use crate::Dispatcher;
-use crate::{AnyOutput, ChainProcess, Groupped, ProgramCollect, RenderResult};
+use crate::{AnyOutput, ChainProcess, Grouped, ProgramCollect, RenderResult};
#[cfg(feature = "structural_renderer")]
use crate::{StructuralRendererSetting, error::StructuralRendererSerializeError};
@@ -23,7 +23,7 @@ pub enum MockProgramCollect {
Bar,
}
-impl Groupped<MockProgramCollect> for MockProgramCollect {
+impl Grouped<MockProgramCollect> for MockProgramCollect {
fn member_id() -> MockProgramCollect {
MockProgramCollect::Foo
}
diff --git a/mingling_core/src/program/hook.rs b/mingling_core/src/program/hook.rs
index 56d8e0e..db1691b 100644
--- a/mingling_core/src/program/hook.rs
+++ b/mingling_core/src/program/hook.rs
@@ -678,7 +678,7 @@ where
#[cfg(test)]
mod tests {
use super::*;
- use crate::Groupped;
+ use crate::Grouped;
use std::sync::atomic::{AtomicBool, Ordering};
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
@@ -694,7 +694,7 @@ mod tests {
}
}
- impl Groupped<MockHookEnum> for MockHookEnum {
+ impl Grouped<MockHookEnum> for MockHookEnum {
fn member_id() -> MockHookEnum {
MockHookEnum::A
}