Skip to main content

WrapperRegistration

Struct WrapperRegistration 

Source
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: WrapperName

Stable 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<'_>) -> bool

Predicate 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

Source

pub fn applies_at(&self, level: WrapperLevel) -> bool

SRD-92 — whether this wrapper is legal at level.

Trait Implementations§

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

Converts 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
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more