Skip to main content

validate_block_count

Function validate_block_count 

Source
pub fn validate_block_count<E>(
    family: impl Into<String>,
    expected: usize,
    got: usize,
) -> Result<(), E>
Expand description

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

On mismatch, builds a BlockCountMismatch and converts it into the caller’s error type E (chosen via the turbofish or inferred from the surrounding ?). On a match, returns Ok(()).

This is the single source of truth for the block-arity guard shared across the family and term modules.