Skip to main content

Module validation

Module validation 

Source
Expand description

Validation utilities for common operations

This module follows the “Parse, don’t validate” pattern: boundary functions transform raw input into types that carry their invariants (NonEmptyString, NonEmptyVec, NonEmptySlice), so downstream code never re-checks.

Structs§

EmptyCollectionError
Error returned when a collection is empty but at least one element is required.
NonEmptySlice
A borrowed slice guaranteed to contain at least one element.
NonEmptyString
A validated string that is guaranteed to be non-empty after trimming.
NonEmptyVec
A vector guaranteed to contain at least one element.

Functions§

validate_all_non_empty
Validate that all strings in a slice are non-empty
validate_identifier
Validate alphanumeric identifier
validate_is_directory
Validate path is a directory
validate_is_file
Validate path is a file
validate_non_empty
Validate that a string is non-empty
validate_non_empty_collection
Validate collection is not empty
validate_non_empty_string
Validate and return non-empty string
validate_optional_non_empty
Validate optional non-empty string
validate_path_exists
Validate path exists
validate_url_format
Basic URL format validation