Skip to content

validate

Shape checks for common user-facing formats: pragmatic subsets that catch real mistakes, not full grammars. None of them normalizes or parses the value, only checks it.

Cargo feature validate (enabled by default). To compile only this module:

cargo add helpers4 --no-default-features --features validate

or in Cargo.toml:

[dependencies]
helpers4 = { version = "0.0.5", default-features = false, features = ["validate"] }

Import path: helpers4::validate.

ItemWhat it does
is_slugChecks whether s has the shape of an ASCII URL slug: non-empty, made only of lowercase ASCII letters, digits and hyphens, with no leading, trailing or doubled hyphen.
is_uuidChecks whether s is a UUID in its canonical 8-4-4-4-12 hyphenated hexadecimal form.
is_valid_emailChecks a pragmatic subset of RFC 5322 that catches real typos, not a full grammar.