Skip to main content

WrappingDispenser

Trait WrappingDispenser 

Source
pub trait WrappingDispenser: OpDispenser { }
Expand description

Marker trait for dispensers that wrap another OpDispenser. Implementing it is the type-level commitment that this layer has overridden OpDispenser::inner_dispenser to expose its inner dispenser. Without that override, cross-cutting machinery (describe(), adapter_metrics, status_counters) silently stops walking at the wrapper, which has been a real source of bugs.

Pure marker — no methods. The chain-walking code already takes &dyn OpDispenser and calls inner_dispenser(); this trait exists to make the wrapper-vs-leaf split visible at the type level and to give SRD-32a’s wrapper registry a bound to require at composition time.

Leaves do not implement this trait — their inner_dispenser falls through to the default None-returning impl on OpDispenser, no boilerplate.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§