pub struct WrapperRegistration {
pub name: WrapperName,
pub owned_fields: &'static [&'static str],
pub triggers: fn(WrapperSubject<'_>) -> bool,
pub requires_inner: &'static [WrapperName],
pub forbids_outer: &'static [WrapperName],
pub mutually_exclusive_with: &'static [WrapperName],
pub describe_assignment: fn(WrapperSubject<'_>) -> Option<String>,
pub levels: &'static [WrapperLevel],
}Expand description
One entry per registered wrapper. Entries are submitted at
link time via inventory::submit! and collected at startup
into the WrapperRegistry view.
The fields here are pure declaration: which fields the
wrapper consumes, when it applies, what relationships it
has to other wrappers, and how it describes its assignment.
Construction of the dispenser layer itself is NOT in the
registration — the cascade in activity.rs continues to
hold the per-wrapper wrap() calls (each has a different
signature). The registry decides PRESENCE and ORDER; the
cascade looks up the resolved plan and dispatches by name.
Fields§
§name: WrapperNameStable name ("validate", "poll", "delay",
"if", "emit", "result", "metrics", "traverse").
owned_fields: &'static [&'static str]Op-template field names this wrapper exclusively owns.
Listed for parse-time validation: a misplaced field like
poll_interval_ms: 5000 on an op without poll: becomes
a hard error pointing at THIS registration, not an opaque
“unknown param”.
Pure data — the parse-time guard reads this; the wrapper
implementation reads its own fields directly off the
ParsedOp.
triggers: fn(WrapperSubject<'_>) -> boolPredicate over the op template: “does this wrapper apply
to this op?” Default behaviour: any owned field present.
Wrappers with no owned fields (e.g. result, which fires
whenever the op declares any result: wires) override
this with their own logic.
requires_inner: &'static [WrapperName]Wrappers that MUST sit inside this one (closer to the
adapter, called after this one per cycle).
Activates transitively: triggering validate pulls in
traverse whether or not a traverse field was declared.
forbids_outer: &'static [WrapperName]Wrappers that MUST NOT sit outside this one. Hard error when the constraint graph would permit any of the listed wrappers to wrap this one.
mutually_exclusive_with: &'static [WrapperName]Wrappers that cannot coexist with this one on a given op. Triggering both is a hard error.
describe_assignment: fn(WrapperSubject<'_>) -> Option<String>One-line summary of what this wrapper, configured for the given op template, will do at runtime. Emitted at Info level once per op-template activation, alongside the other wrappers in the resolved plan.
Examples:
validate:"validate: min_rows ≥ 1 (strict)"poll:"poll: every 5s, timeout 600s, on \await_empty`“`if:"if: cql_dialect == 'cass5'"
Returns None for wrappers that have nothing useful to
say (e.g. an always-on traverse with no per-op
configuration); operators see the wrappers that actually
shape behaviour, the boilerplate stays at Debug.
Distinct from OpDispenser::describe() which describes
the runtime op — e.g. the CQL statement text — for
error-context dumps. This describes the wrapper’s
contribution for init-time diagnostics.
levels: &'static [WrapperLevel]SRD-92 / ExecUnification — the execution-graph level(s) this wrapper is
legal at. Every current wrapper is &[WrapperLevel::Op]; the unified
scaffold reads this to know where a layer may sit. Carried as metadata
now; consumed when layering goes cross-level (Step 5).
Implementations§
Source§impl WrapperRegistration
impl WrapperRegistration
Sourcepub fn applies_at(&self, level: WrapperLevel) -> bool
pub fn applies_at(&self, level: WrapperLevel) -> bool
SRD-92 — whether this wrapper is legal at level.
Trait Implementations§
impl Collect for WrapperRegistration
Auto Trait Implementations§
impl Freeze for WrapperRegistration
impl RefUnwindSafe for WrapperRegistration
impl Send for WrapperRegistration
impl Sync for WrapperRegistration
impl Unpin for WrapperRegistration
impl UnsafeUnpin for WrapperRegistration
impl UnwindSafe for WrapperRegistration
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more