1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
//! ServiceActivatorSpec: specification for a single processing service (activator) binding logic between channels.
//!
//! # Purpose
//! Represents a unit of executable logic (a processor) wired between an inbound (`from`) and
//! outbound (`to`) channel. The `ref_name` field is a symbolic reference matching the
//! `#[service(name=...)]` macro parameter used to locate the registered implementation (not a file path).
//!
//! # Field Semantics
//! * `id` (optional): Explicit identifier for referencing/diagnostics. Missing ids may be assigned
//! deterministically by a future collection builder (`service:auto.N`).
//! * `ref_name` (required, non-empty): Reference identifier matching the service macro name; links YAML spec to runtime descriptor.
//! * `from` (required, non-empty): Inbound channel id the service consumes messages from.
//! * `to` (required, non-empty): Outbound channel id the service publishes processed messages to.
//!
//! # Uniqueness & Validation
//! * Parser enforces presence and non-empty strings for required fields; uniqueness of `id` deferred.
//! * Validation does not enforce any naming pattern for `ref_name` beyond non-empty.
//!
//! # Runtime Mapping
//! `ServiceActivatorSpec` does not itself execute code; builders transform the spec into a runtime
//! processor abstraction matched against inventory descriptors submitted by the macro.
//!
//! # Construction Helpers
//! * `new(ref_name, from, to)` – minimal spec without id.
//! * `with_id(id, ref_name, from, to)` – explicit id.
//! * `id()` / `ref_name()` / `from()` / `to()` – accessors.
//! * `set_id(id)` – internal builder use for auto-id assignment.
//!
//! # Example
//! ```rust
//! use allora_runtime::spec::ServiceActivatorSpec;
//! let spec = ServiceActivatorSpec::new("hello_world", "inbound.orders", "vetted.orders");
//! assert_eq!(spec.ref_name(), "hello_world");
//! assert_eq!(spec.from(), "inbound.orders");
//! assert_eq!(spec.to(), "vetted.orders");
//! ```