pub struct ValidatingDispenser { /* private fields */ }Expand description
Op dispenser wrapper that validates results after execution.
Applied only to templates that declare verify: or relevancy:
blocks. Zero overhead for templates without validation.
Implementations§
Source§impl ValidatingDispenser
impl ValidatingDispenser
Sourcepub fn wrap(
inner: Arc<dyn OpDispenser>,
template: &ParsedOp,
labels: &Labels,
program: Option<&PolydatProgram>,
fx: &mut ScopeFixture,
) -> Result<(Arc<dyn OpDispenser>, Option<Arc<ValidationMetrics>>), String>
pub fn wrap( inner: Arc<dyn OpDispenser>, template: &ParsedOp, labels: &Labels, program: Option<&PolydatProgram>, fx: &mut ScopeFixture, ) -> Result<(Arc<dyn OpDispenser>, Option<Arc<ValidationMetrics>>), String>
Wrap a dispenser with validation, registering the relevancy
expected binding into the supplied scope fixture.
Returns the inner dispenser unchanged if none of verify:,
relevancy: and admission: is declared.
Sourcepub fn wrap_in_cells(
inner: Arc<dyn OpDispenser>,
template: &ParsedOp,
labels: &Labels,
program: Option<&PolydatProgram>,
fx: &mut ScopeFixture,
cells: Option<Arc<OpCells>>,
) -> Result<(Arc<dyn OpDispenser>, Option<Arc<ValidationMetrics>>), String>
pub fn wrap_in_cells( inner: Arc<dyn OpDispenser>, template: &ParsedOp, labels: &Labels, program: Option<&PolydatProgram>, fx: &mut ScopeFixture, cells: Option<Arc<OpCells>>, ) -> Result<(Arc<dyn OpDispenser>, Option<Arc<ValidationMetrics>>), String>
As Self::wrap, for an op that places its measurements in
cells (cell: on the op): every score and outcome is recorded
in the cycle’s cell of cells as well as in the op’s totals.
Trait Implementations§
Source§impl OpDispenser for ValidatingDispenser
impl OpDispenser for ValidatingDispenser
Source§fn inner_dispenser(&self) -> Option<&dyn OpDispenser>
fn inner_dispenser(&self) -> Option<&dyn OpDispenser>
Expose the wrapped dispenser so describe() can
walk through this layer to reach the adapter
(raw / prepared / batch). Without this override,
the default trait method returns None, the
describe walk stops here, and the error-context
dump loses the CQL statement text.
Source§fn execute<'a>(
&'a self,
cycle: u64,
ctx: &'a ExecCtx<'a>,
) -> Pin<Box<dyn Future<Output = Result<OpResult, ExecutionError>> + Send + 'a>>
fn execute<'a>( &'a self, cycle: u64, ctx: &'a ExecCtx<'a>, ) -> Pin<Box<dyn Future<Output = Result<OpResult, ExecutionError>> + Send + 'a>>
Source§fn describe(&self) -> Option<String>
fn describe(&self) -> Option<String>
{table}, {key}, ?, …). Read moreSource§fn describe_resolved(&self, wires: &dyn WireSource) -> Option<String>
fn describe_resolved(&self, wires: &dyn WireSource) -> Option<String>
Source§fn canonical_kernel(&self) -> Option<&Arc<dyn Kernel>>
fn canonical_kernel(&self) -> Option<&Arc<dyn Kernel>>
map_op from its parent — the
parent itself, or a kernel bound under it. Any engine: the
executor finds the program to bind per fiber by program_id.
Returns None for dispensers that don’t own a kernel
(adapters with no Polydat needs, or wrappers that delegate to
an inner dispenser). Read moreSource§fn adapter_metrics(&self) -> Vec<(String, Labels, MetricValue)>
fn adapter_metrics(&self) -> Vec<(String, Labels, MetricValue)>
Source§fn status_counters(&self) -> Vec<(&str, u64)>
fn status_counters(&self) -> Vec<(&str, u64)>
Source§fn rows_per_op(&self) -> usize
fn rows_per_op(&self) -> usize
execute call reads and covers. Read moreimpl WrappingDispenser for ValidatingDispenser
Auto Trait Implementations§
impl !RefUnwindSafe for ValidatingDispenser
impl !UnwindSafe for ValidatingDispenser
impl Forget for ValidatingDispenser
impl Freeze for ValidatingDispenserwhere
*const ArcInner<dyn OpDispenser> is !null: Freeze,
PhantomData<ArcInner<dyn OpDispenser>>: Freeze,
*const u8 is !null: Freeze,
PhantomData<AssertionSpec>: Freeze,
PhantomData<u8>: Freeze,
PhantomData<RelevancyFn>: Freeze,
PhantomData<PathSeg>: Freeze,
*const ArcInner<ValidationMetrics> is !null: Freeze,
PhantomData<ArcInner<ValidationMetrics>>: Freeze,
*const ArcInner<OpCells> is !null: Freeze,
PhantomData<ArcInner<OpCells>>: Freeze,
impl Move for ValidatingDispenser
impl Send for ValidatingDispenserwhere
Arc<dyn OpDispenser>: Send,
RawVecInner: Send,
Arc<ValidationMetrics>: Send,
Arc<OpCells>: Send,
impl Sync for ValidatingDispenserwhere
Arc<dyn OpDispenser>: Sync,
RawVecInner: Sync,
Arc<ValidationMetrics>: Sync,
Arc<OpCells>: Sync,
impl Unpin for ValidatingDispenser
impl UnsafeUnpin for ValidatingDispenserwhere
*const ArcInner<dyn OpDispenser> is !null: UnsafeUnpin,
PhantomData<ArcInner<dyn OpDispenser>>: UnsafeUnpin,
*const u8 is !null: UnsafeUnpin,
PhantomData<AssertionSpec>: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
PhantomData<RelevancyFn>: UnsafeUnpin,
PhantomData<PathSeg>: UnsafeUnpin,
*const ArcInner<ValidationMetrics> is !null: UnsafeUnpin,
PhantomData<ArcInner<ValidationMetrics>>: UnsafeUnpin,
*const ArcInner<OpCells> is !null: UnsafeUnpin,
PhantomData<ArcInner<OpCells>>: UnsafeUnpin,
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