pub struct RequestLocale {
pub code: Option<String>,
pub stripped_path: String,
pub explicit: bool,
}Expand description
What resolve_request_locale returns: the active locale code
(if any) plus the URL path with the locale segment removed (so
downstream slug resolution sees the same /about whether the
request came in as /about?lang=es or /es/about).
Fields§
§code: Option<String>Locale code resolved from the request, in mode’s priority
order. None means “fall through to the tenant default”.
stripped_path: StringThe request path with any locale prefix stripped.
explicit: booltrue when code came from an EXPLICIT source (?lang= or a
/<code>/ path prefix), as opposed to the persistence cookie or
Accept-Language. The router (re)writes the locale cookie only on
an explicit choice, so a plain nav click never churns it.
Trait Implementations§
Source§impl Clone for RequestLocale
impl Clone for RequestLocale
Auto Trait Implementations§
impl Forget for RequestLocale
impl Freeze for RequestLocale
impl RefUnwindSafe for RequestLocale
impl Send for RequestLocale
impl Sync for RequestLocale
impl Unpin for RequestLocale
impl UnsafeUnpin for RequestLocale
impl UnwindSafe for RequestLocale
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreCreates a shared type from an unshared type.