pub struct RouteCtx { /* private fields */ }Expand description
What a contributed route is given at boot.
Deliberately narrow: the admin’s own router state stays private, so its
composition can change without breaking a screen. Fields are read through
accessors, so this can gain context after 1.0; new cannot, and extra context
would arrive as a builder.
Implementations§
Source§impl RouteCtx
impl RouteCtx
pub fn db(&self) -> &Db
Sourcepub fn base_path(&self) -> &str
pub fn base_path(&self) -> &str
Where this screen actually mounted, after the module namespace, any base it declared, the deployment’s overrides and the admin mount.
Sourcepub fn admin_path(&self) -> &str
pub fn admin_path(&self) -> &str
Where the admin panel is mounted, after backend.path. Ask rather than
assuming /admin: an operator may have moved it, and a module building a
link into the panel, or excluding it from a sitemap, needs the real one.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for RouteCtx
impl !UnwindSafe for RouteCtx
impl Freeze for RouteCtx
impl Send for RouteCtx
impl Sync for RouteCtx
impl Unpin for RouteCtx
impl UnsafeUnpin for RouteCtx
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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