pub struct RouteCtxBuilder { /* private fields */ }Expand description
Builds a RouteCtx. Every field has a default, so a test names only what it
asserts on.
Implementations§
Source§impl RouteCtxBuilder
impl RouteCtxBuilder
Sourcepub fn base_path(self, path: impl Into<String>) -> Self
pub fn base_path(self, path: impl Into<String>) -> Self
Where the screen mounted. Defaults to /.
Sourcepub fn admin_path(self, path: impl Into<String>) -> Self
pub fn admin_path(self, path: impl Into<String>) -> Self
Where the panel mounted. Defaults to /admin, which is what a route
excluding the panel should not be allowed to assume: set it to something
else in a test that checks the exclusion is read rather than hardcoded.
Sourcepub fn base_url(self, url: impl Into<String>) -> Self
pub fn base_url(self, url: impl Into<String>) -> Self
The site’s origin. Defaults to http://localhost.
Sourcepub fn contributions(self, registry: Arc<Registry>) -> Self
pub fn contributions(self, registry: Arc<Registry>) -> Self
The contributions RouteCtx::contributions will read. Defaults to empty.
Sourcepub fn events(self, events: Events) -> Self
pub fn events(self, events: Events) -> Self
The bus RouteCtx::events will hand out. Defaults to one nothing
listens on; pass one built with a listener to assert on what a route
announces.
Sourcepub fn auth(self, auth: AuthService) -> Self
pub fn auth(self, auth: AuthService) -> Self
The auth service RouteCtx::audit writes through. Without one, a
default service over the same database.
pub fn build(self) -> RouteCtx
Auto Trait Implementations§
impl !RefUnwindSafe for RouteCtxBuilder
impl !UnwindSafe for RouteCtxBuilder
impl Freeze for RouteCtxBuilder
impl Send for RouteCtxBuilder
impl Sync for RouteCtxBuilder
impl Unpin for RouteCtxBuilder
impl UnsafeUnpin for RouteCtxBuilder
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