pub struct DispatchableFunction<'a> {
pub name: &'a str,
pub kind: Option<BuiltinKind>,
pub aliases: &'static [&'static str],
}Expand description
One function an engine will actually dispatch.
Yielded by crate::Engine::dispatchable_functions and
crate::EngineBuilder::dispatchable_functions. Together with
BuiltinKind this is the whole authoring-side vocabulary: kind says how
the name reaches an implementation, and aliases says which other spellings
resolve to the same one.
Fields§
§name: &'a strThe canonical name. Alternative spellings are listed in
Self::aliases rather than yielded as separate entries.
kind: Option<BuiltinKind>Some(..) for a built-in; None for a name backed only by a registered
custom handler.
The Option deliberately mirrors builtin_function_kind, where
None already means “not a built-in”. BuiltinKind is not
#[non_exhaustive] on purpose, so widening it with a third variant
would break every downstream match; this carries the same fact
additively.
aliases: &'static [&'static str]Other accepted spellings of this same function.
validate carries ["validation"]; every other name is empty today.
An alias never appears as its own entry, but
crate::Engine::can_dispatch does accept it — a task named
validation really does execute.
Trait Implementations§
Source§impl<'a> Clone for DispatchableFunction<'a>
impl<'a> Clone for DispatchableFunction<'a>
Source§fn clone(&self) -> DispatchableFunction<'a>
fn clone(&self) -> DispatchableFunction<'a>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more