Skip to main content

assert_capabilities_truthful

Function assert_capabilities_truthful 

Source
pub async fn assert_capabilities_truthful<S, F, Fut>(
    sink: &S,
    distinct_count: F,
)
where S: Sink + ?Sized, F: Fn() -> Fut, Fut: Future<Output = usize>,
Expand description

Check 5. Assert a sink’s advertised capabilities match real behaviour:

  • Append (always supported) actually adds rows;
  • a declared idempotent/keyed mechanism actually dedups (reuses check 4);
  • supports_schema_evolution() implies evolve_schema is callable (not the default “unsupported” error);
  • the honest-false branch: a non-idempotent sink’s write_batch_idempotent delegates to write_batch and records no token.

distinct_count reports the destination’s current distinct-row count.