#[non_exhaustive]pub enum Case {
Sensitive,
AsciiInsensitive,
}Expand description
How a namespace’s table compares names.
Folding is a property of the table: every name stored in it, and every
name looked up in it, is compared through the same fold. Folding is
deterministic and independent of locale; diagnostics, the index, and
ClassMember keep each name as it was written.
Only ASCII folding is offered: it is what PHP 8 does for function,
class, interface, trait, enum, and namespace names (bytes A-Z match
a-z; every other byte, including UTF-8 sequences, must match
exactly). Unicode case folding is not provided: no target language needs
it, and its tables change with the Unicode version, which would make
resolution depend on the toolchain.
§Examples
use resolve_lang::{Case, Namespace, Policy};
assert_eq!(Policy::php().case(Namespace::Value), Case::AsciiInsensitive);
assert_eq!(Policy::php().case(Namespace::Const), Case::Sensitive);
assert_eq!(Policy::python().case(Namespace::Value), Case::Sensitive);Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Sensitive
Names match only when spelled identically (the default everywhere).
AsciiInsensitive
Names match when they are equal after mapping ASCII A-Z to
a-z (PHP 8).