pub struct ApplicationModule { /* private fields */ }Expand description
One website/API/admin module mounted into the same Phoenix process.
Implementations§
Source§impl ApplicationModule
impl ApplicationModule
Sourcepub fn new(name: impl Into<String>, routes: Routes) -> Self
pub fn new(name: impl Into<String>, routes: Routes) -> Self
Create a module mounted at /{name} with route names prefixed by {name}..
pub fn prefix(self, prefix: impl Into<String>) -> Self
Sourcepub fn host(self, host: impl Into<String>) -> Self
pub fn host(self, host: impl Into<String>) -> Self
Restrict this module to a Host authority. A host without a port matches any port.
Sourcepub fn name_prefix(self, prefix: impl Into<String>) -> Self
pub fn name_prefix(self, prefix: impl Into<String>) -> Self
Override the automatic {application}. named-route prefix.
Sourcepub fn middleware<M>(self, middleware: M) -> Selfwhere
M: Middleware,
pub fn middleware<M>(self, middleware: M) -> Selfwhere
M: Middleware,
Apply middleware only to routes in this application module.
Auto Trait Implementations§
impl !RefUnwindSafe for ApplicationModule
impl !UnwindSafe for ApplicationModule
impl Freeze for ApplicationModule
impl Send for ApplicationModule
impl Sync for ApplicationModule
impl Unpin for ApplicationModule
impl UnsafeUnpin for ApplicationModule
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