pub trait Locale:
Segment
+ Serialize
+ Copy
+ Eq
+ 'static {
type Text<T>;
const ALL: &'static [Self];
// Required method
fn pick<T>(self, text: Self::Text<T>) -> T;
// Provided method
fn tag(self) -> String { ... }
}Expand description
The locales of an application: an enum with #[derive(Segment)] whose segments are BCP 47 tags.
The compiler checks that each text has every locale, through
Locale::Text, and that Locale::pick handles every locale, through
its match. It does not check that Locale::ALL lists every variant;
a variant left out of it is never chosen by negotiate.
Required Associated Constants§
Required Associated Types§
Required Methods§
Provided Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".