Skip to main content

Module block_count

Module block_count 

Source
Expand description

Shared block-count arity guard.

Every family / term entry point that consumes a &[ParameterBlockState] opens with the identical check: “this family expects exactly N blocks; reject any other count”. The structure is fixed — only the family name, the expected arity, and the per-module error enum vary. This module holds the single canonical implementation so the guard is not re-typed by hand across modules.

The canonical error message is owned by BlockCountMismatch::message. Each module routes its own error enum through From<BlockCountMismatch>, so the per-module error identity (and its Display/variant) is preserved while the arity-check logic and the message wording live in one place.

Structs§

BlockCountMismatch
A block-count arity mismatch: a family that needs exactly expected parameter blocks was handed got of them.

Functions§

validate_block_count
Reject any got block count that does not exactly equal expected.