Raxol.Core.Utils.Validation (Raxol v2.0.1)
View SourceCommon validation utilities to reduce code duplication across the codebase. Provides standardized validation functions for dimensions, configs, and common patterns.
Summary
Functions
Validates that a value is within specified bounds.
Validates a configuration map against required keys.
Validates that coordinates are valid non-negative integers.
Validates that a dimension is a positive integer, returning default if invalid.
Validates that a value is one of the allowed options.
Validates that a list contains only specific types.
Validates that a string is not empty and optionally matches a pattern.
Functions
Validates that a value is within specified bounds.
Validates a configuration map against required keys.
@spec validate_coordinates(integer(), integer()) :: {:ok, {non_neg_integer(), non_neg_integer()}} | {:error, :invalid_coordinates}
Validates that coordinates are valid non-negative integers.
@spec validate_dimension(integer(), non_neg_integer()) :: non_neg_integer()
Validates that a dimension is a positive integer, returning default if invalid.
Validates that a value is one of the allowed options.
Validates that a list contains only specific types.
Validates that a string is not empty and optionally matches a pattern.