pub struct ViewModule { /* private fields */ }Expand description
Module that registers a ViewRenderer provider.
Implementations§
Source§impl ViewModule
impl ViewModule
pub fn new<E>(name: &'static str, engine: E) -> Selfwhere
E: ViewEngine,
pub fn from_renderer(name: &'static str, renderer: ViewRenderer) -> Self
pub fn global(self) -> Self
pub fn renderer(&self) -> ViewRenderer
Trait Implementations§
Source§impl Clone for ViewModule
impl Clone for ViewModule
Source§fn clone(&self) -> ViewModule
fn clone(&self) -> ViewModule
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ViewModule
impl Debug for ViewModule
Source§impl Module for ViewModule
impl Module for ViewModule
Source§fn providers(&self) -> Result<Vec<ProviderDefinition>>
fn providers(&self) -> Result<Vec<ProviderDefinition>>
Providers exported into the application container.
Source§fn exports(&self) -> Result<Vec<ProviderToken>>
fn exports(&self) -> Result<Vec<ProviderToken>>
Providers this module exposes to importing modules.
Source§fn is_global(&self) -> bool
fn is_global(&self) -> bool
Whether exported providers should be visible to every module scope.
Source§fn imports(&self) -> Vec<Arc<dyn Module>>
fn imports(&self) -> Vec<Arc<dyn Module>>
Imported modules that should be registered before this module.
Source§fn forward_imports(&self) -> Vec<Arc<dyn Module>>
fn forward_imports(&self) -> Vec<Arc<dyn Module>>
Forward module imports for intentional circular module relationships. Read more
Source§fn route_prefix(&self) -> Option<&str>
fn route_prefix(&self) -> Option<&str>
Optional HTTP route prefix applied to controllers and direct routes in this module and its imports.
Source§fn middleware(&self) -> Vec<Arc<dyn Middleware>>
fn middleware(&self) -> Vec<Arc<dyn Middleware>>
Middleware applied to controllers and direct routes declared by this module.
Source§fn configure(
&self,
_consumer: &mut MiddlewareConsumer,
_module_ref: &ModuleRef,
) -> Result<()>
fn configure( &self, _consumer: &mut MiddlewareConsumer, _module_ref: &ModuleRef, ) -> Result<()>
Configure route-scoped middleware with a Nest-style consumer.
Source§fn controllers(
&self,
_module_ref: &ModuleRef,
) -> Result<Vec<ControllerDefinition>>
fn controllers( &self, _module_ref: &ModuleRef, ) -> Result<Vec<ControllerDefinition>>
Controller route groups built with access to the provider container.
Source§fn routes(&self) -> Result<Vec<RouteDefinition>>
fn routes(&self) -> Result<Vec<RouteDefinition>>
Framework-neutral routes contributed directly by this module.
Source§fn gateways(
&self,
_module_ref: &ModuleRef,
) -> Result<Vec<WebSocketGatewayDefinition>>
fn gateways( &self, _module_ref: &ModuleRef, ) -> Result<Vec<WebSocketGatewayDefinition>>
WebSocket gateways contributed by this module.
Source§fn message_patterns(
&self,
_module_ref: &ModuleRef,
) -> Result<Vec<MessagePatternDefinition>>
fn message_patterns( &self, _module_ref: &ModuleRef, ) -> Result<Vec<MessagePatternDefinition>>
Microservice message patterns contributed by this module.
Source§fn on_module_init(&self, _module_ref: &ModuleRef) -> Result<()>
fn on_module_init(&self, _module_ref: &ModuleRef) -> Result<()>
Lifecycle hook called after imports and providers are registered.
Source§fn on_application_bootstrap(
&self,
_module_ref: ModuleRef,
) -> BoxFuture<'static, Result<()>>
fn on_application_bootstrap( &self, _module_ref: ModuleRef, ) -> BoxFuture<'static, Result<()>>
Async lifecycle hook called by hosts that want startup work before serve.
Source§fn on_module_destroy(
&self,
_module_ref: ModuleRef,
_signal: Option<String>,
) -> BoxFuture<'static, Result<()>>
fn on_module_destroy( &self, _module_ref: ModuleRef, _signal: Option<String>, ) -> BoxFuture<'static, Result<()>>
Async lifecycle hook called when shutdown begins.
Source§fn before_application_shutdown(
&self,
_module_ref: ModuleRef,
_signal: Option<String>,
) -> BoxFuture<'static, Result<()>>
fn before_application_shutdown( &self, _module_ref: ModuleRef, _signal: Option<String>, ) -> BoxFuture<'static, Result<()>>
Async lifecycle hook called after module destroy hooks and before final shutdown hooks.
Source§fn on_application_shutdown(
&self,
_module_ref: ModuleRef,
) -> BoxFuture<'static, Result<()>>
fn on_application_shutdown( &self, _module_ref: ModuleRef, ) -> BoxFuture<'static, Result<()>>
Async lifecycle hook called by hosts that need graceful shutdown cleanup.
Source§fn on_application_shutdown_with_signal(
&self,
module_ref: ModuleRef,
_signal: Option<String>,
) -> BoxFuture<'static, Result<()>>
fn on_application_shutdown_with_signal( &self, module_ref: ModuleRef, _signal: Option<String>, ) -> BoxFuture<'static, Result<()>>
Signal-aware variant of
Module::on_application_shutdown.Auto Trait Implementations§
impl !RefUnwindSafe for ViewModule
impl !UnwindSafe for ViewModule
impl Freeze for ViewModule
impl Send for ViewModule
impl Sync for ViewModule
impl Unpin for ViewModule
impl UnsafeUnpin for ViewModule
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