pub enum DomainRule {
Any,
Exact(String),
Wildcard(String),
Regex(Regex),
}Variants§
Any
Exact(String)
Wildcard(String)
Matches when hostname ends with s[1..] (the wildcard pattern with
the leading * stripped) and the remaining leftmost prefix is
non-empty and contains no .. Comparison is byte-exact and no
IDN/punycode normalisation is performed here: the pattern was
already lowercased by DomainRule::from_str’s
idna::domain_to_ascii, and the hostname it is handed has been
through normalize_hostname in Router::lookup, so both
sides are ASCII-lowercase by the time they meet. Stored with the
leading *.
Regex(Regex)
Anchored full-host regex built by convert_regex_domain_rule.
Unlike the other variants its source is NOT lowercased — it is
compiled case-insensitively instead, so an uppercase literal
still matches the normalised key. See DomainRule::from_str
for why that folding is Unicode-aware while the hostnames it is
ever handed are ASCII.