pub struct AppBuilder { /* private fields */ }Expand description
Builder returned by App::new.
Implementations§
Source§impl AppBuilder
impl AppBuilder
Sourcepub fn config(self, config: Config) -> Self
pub fn config(self, config: Config) -> Self
Use an explicit configuration instead of discovering next-rust.toml.
pub fn environment(self, env: Environment) -> Self
Sourcepub fn middleware(self, mw: impl Middleware) -> Self
pub fn middleware(self, mw: impl Middleware) -> Self
Add global middleware (runs before middleware.rs files, in order).
Sourcepub fn page_store(self, store: impl CacheStore) -> Self
pub fn page_store(self, store: impl CacheStore) -> Self
Store for statically rendered pages (default: files in the build output in production, memory in development).
pub fn plugin(self, plugin: impl Plugin) -> Self
Sourcepub fn route<H, Fut, R>(self, method: Method, pattern: &str, handler: H) -> Self
pub fn route<H, Fut, R>(self, method: Method, pattern: &str, handler: H) -> Self
Register a handler programmatically for any method.
Patterns accept /users/:id, /files/*path or /users/[id].
pub fn get<H, Fut, R>(self, pattern: &str, handler: H) -> Self
pub fn post<H, Fut, R>(self, pattern: &str, handler: H) -> Self
Auto Trait Implementations§
impl !RefUnwindSafe for AppBuilder
impl !UnwindSafe for AppBuilder
impl Forget for AppBuilder
impl Freeze for AppBuilder
impl Move for AppBuilder
impl Send for AppBuilder
impl Sync for AppBuilder
impl Unpin for AppBuilder
impl UnsafeUnpin for AppBuilder
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