Skip to main content

Module validate

Module validate 

Source

Enums§

AccessRuleValidationError
Errors from validating an AccessRuleAddEditRequest before it is sent to the server.

Constants§

MAX_CONDITIONS 🔒
MAX_NAME_LENGTH 🔒
Maximum length of an access rule’s name field, matching the server’s constraint.

Functions§

is_valid_cidr
Returns true for a canonical CIDR range such as 10.0.0.0/8, with no host bits set. Ambiguous forms (leading-zero or hex octets, IPv4-mapped IPv6) are rejected so client and server agree on which network a rule matches.
no_host_bits 🔒
Returns true when the low width - prefix host bits of addr are all zero. Requires prefix <= width; the host_bits == 0 check also avoids u128::MAX >> 128, which panics.
validate_request
Validates a request before it is sent to the server. Unknown condition kinds are left to the server.