#[non_exhaustive]pub struct I18nConfig {
pub locales_path: String,
pub default_locale: String,
pub locale_cookie: String,
pub locale_query_param: String,
}Expand description
Configuration for the i18n module.
All fields have sensible defaults and can be overridden via YAML config. Paths are relative to the working directory of the running process.
§Defaults
| Field | Default |
|---|---|
locales_path | "locales" |
default_locale | "en" |
locale_cookie | "lang" |
locale_query_param | "lang" |
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.locales_path: StringDirectory that contains locale subdirectories with YAML translation files.
default_locale: StringBCP 47 language tag used when no locale can be resolved from the request.
Cookie name read by CookieResolver to determine the active locale.
locale_query_param: StringQuery-string parameter name read by QueryParamResolver.
Trait Implementations§
Source§impl Clone for I18nConfig
impl Clone for I18nConfig
Source§fn clone(&self) -> I18nConfig
fn clone(&self) -> I18nConfig
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for I18nConfig
impl Debug for I18nConfig
Source§impl Default for I18nConfig
impl Default for I18nConfig
Source§impl<'de> Deserialize<'de> for I18nConfigwhere
I18nConfig: Default,
impl<'de> Deserialize<'de> for I18nConfigwhere
I18nConfig: Default,
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for I18nConfig
impl RefUnwindSafe for I18nConfig
impl Send for I18nConfig
impl Sync for I18nConfig
impl Unpin for I18nConfig
impl UnsafeUnpin for I18nConfig
impl UnwindSafe for I18nConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more