pub enum FunctionConfig {
Map {
name: MapName,
input: MapConfig,
},
Validation {
name: ValidationName,
input: ValidationConfig,
},
ParseJson {
name: ParseJsonName,
input: ParseConfig,
},
ParseXml {
name: ParseXmlName,
input: ParseConfig,
},
PublishJson {
name: PublishJsonName,
input: PublishConfig,
},
PublishXml {
name: PublishXmlName,
input: PublishConfig,
},
Filter {
name: FilterName,
input: FilterConfig,
},
Log {
name: LogName,
input: LogConfig,
},
HttpCall {
name: HttpCallName,
input: HttpCallConfig,
},
Enrich {
name: EnrichName,
input: EnrichConfig,
},
PublishKafka {
name: PublishKafkaName,
input: PublishKafkaConfig,
},
Custom {
name: String,
input: Value,
compiled_input: Option<CompiledCustomInput>,
},
}Expand description
Enum containing all possible function configurations.
Deserialization dispatches on the name field: each known built-in
(map, validate, parse_json, …) parses its input strictly into the
matching typed config and errors with a clear envelope (config for function 'map': missing field 'mappings'). Unknown names fall through
to FunctionConfig::Custom, which preserves the raw input for a
user-registered handler to consume at engine construction time.
Variants§
Map
Validation
ParseJson
ParseXml
PublishJson
PublishXml
Filter
Log
HttpCall
Enrich
PublishKafka
Custom
For custom or unknown functions, store raw input and a slot for the pre-parsed typed value populated at engine construction time.
Fields
compiled_input: Option<CompiledCustomInput>Pre-parsed <RegisteredHandler as AsyncFunctionHandler>::Input,
boxed as dyn Any. Set by the engine after handler registration;
None on initial deserialization. FunctionConfig is
deserialize-only — round-tripping a workflow through JSON
re-parses on the next Engine::new() call.
Implementations§
Source§impl FunctionConfig
impl FunctionConfig
Sourcepub fn function_name(&self) -> &str
pub fn function_name(&self) -> &str
Get the function name for this configuration
Sourcepub fn connector(&self) -> Option<&str>
pub fn connector(&self) -> Option<&str>
Whether this is a synchronous built-in. Synchronous built-ins can share
a single ArenaContext lifetime across consecutive tasks within a
workflow without crossing any .await point.
Must match the variants handled in Self::try_execute_in_arena; the
debug assertion below ties the two together so they can’t drift.
The connector this task references, if any.
The three integration variants return their typed connector field
verbatim — including an empty string. Whether an empty connector name is
acceptable is a validation question for the host, not this accessor’s.
FunctionConfig::Custom returns input["connector"] when that key
holds a string. That is the convention for service-registered integration
handlers, mirroring the three built-in schemas; a Custom input whose
connector key means something else is a false positive, and the
convention is the only contract available.
Usable without a crate::Task: FunctionConfig deserializes from a
bare {"name": .., "input": ..} object, so a caller holding only a task’s
function value does not need to satisfy Task’s required id and
name.
The match is exhaustive on purpose — a future connector-bearing config cannot be silently omitted.
pub fn is_sync_builtin(&self) -> bool
Trait Implementations§
Source§impl Clone for FunctionConfig
impl Clone for FunctionConfig
Source§fn clone(&self) -> FunctionConfig
fn clone(&self) -> FunctionConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more