#[non_exhaustive]pub struct PublicRouteReg {
pub path: String,
pub route: Arc<dyn PublicRoute>,
}Expand description
A registered public route.
The path is literal and never namespaced: /robots.txt has to be exactly
that. Collisions are therefore likelier than in the admin, so two claims on
one path, or a claim on the admin mount, abort the boot.
Built with PublicRouteReg::new. Non-exhaustive for the same reason as
ScreenReg.
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.path: String§route: Arc<dyn PublicRoute>Implementations§
Source§impl PublicRouteReg
impl PublicRouteReg
pub fn new(path: impl Into<String>, route: Arc<dyn PublicRoute>) -> Self
Sourcepub fn site(route: Arc<dyn PublicRoute>) -> Self
pub fn site(route: Arc<dyn PublicRoute>) -> Self
The site itself: the route every URL reaches that no admin route and no other public route serves, in place of the panel’s own 404. One module may register it; a second aborts the boot as a clash.
Sourcepub fn is_site(&self) -> bool
pub fn is_site(&self) -> bool
Whether this registration is the site (see PublicRouteReg::site).
Auto Trait Implementations§
impl !RefUnwindSafe for PublicRouteReg
impl !UnwindSafe for PublicRouteReg
impl Freeze for PublicRouteReg
impl Send for PublicRouteReg
impl Sync for PublicRouteReg
impl Unpin for PublicRouteReg
impl UnsafeUnpin for PublicRouteReg
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
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 more