string
ModuleString validators: substrings, globs, colors and phone numbers.
Contents
Structs
ContainsA string containing at least one of the patterns, case-insensitively unless strict.GlobstarA string matching gitignore-style glob patterns (`*`, `**`, `?`, `[...]`, `\` escapes, `!` exclusions).HexColorA hexadecimal color code of 3 or 6 digits, without `#`: `fff` or `ffffff`.PhoneAn E.164 phone number (`+` and 7 to 15 digits, the first not 0), optionally repaired by `Phone::normalize` first.WildcardAccepts every value.use utopia_validators::Contains;Rust
pub struct ContainsA string containing at least one of the patterns, case-insensitively unless strict.
use utopia_validators::Globstar;Rust
pub struct GlobstarA string matching gitignore-style glob patterns (*, **, ?, [...],
\ escapes, ! exclusions).
Inclusions are OR-ed and exclusions AND-ed; a literal inclusion beats a wildcard exclusion; otherwise the last matching pattern wins. Without patterns every string is valid.
use utopia_validators::HexColor;Rust
pub struct HexColorA hexadecimal color code of 3 or 6 digits, without #: fff or ffffff.
use utopia_validators::Phone;Rust
pub struct PhoneAn E.164 phone number (+ and 7 to 15 digits, the first not 0),
optionally repaired by Phone::normalize first.
use utopia_validators::Wildcard;Rust
pub struct WildcardAccepts every value.