pub struct Application { /* private fields */ }
Expand description
Application that manages modules, providers, and container with lifecycle management
Implementations§
Source§impl Application
impl Application
Sourcepub fn builder() -> ApplicationBuilder
pub fn builder() -> ApplicationBuilder
Create a new application builder
Sourcepub fn state(&self) -> &ApplicationState
pub fn state(&self) -> &ApplicationState
Get application state
Sourcepub fn modules(&mut self) -> &mut ModuleRegistry
pub fn modules(&mut self) -> &mut ModuleRegistry
Get module registry
Sourcepub fn routes(&mut self) -> &[RouteDefinition]
pub fn routes(&mut self) -> &[RouteDefinition]
Get all routes from modules
Sourcepub fn middleware(&mut self) -> &[MiddlewareDefinition]
pub fn middleware(&mut self) -> &[MiddlewareDefinition]
Get all middleware from modules (sorted by priority)
Sourcepub fn is_running(&self) -> bool
pub fn is_running(&self) -> bool
Check if application is running
Sourcepub async fn start(&mut self) -> Result<(), ApplicationError>
pub async fn start(&mut self) -> Result<(), ApplicationError>
Start the application with full lifecycle management
Sourcepub async fn run(&mut self) -> Result<(), ApplicationError>
pub async fn run(&mut self) -> Result<(), ApplicationError>
Run the application with signal handling
Sourcepub async fn shutdown(&mut self) -> Result<(), ApplicationError>
pub async fn shutdown(&mut self) -> Result<(), ApplicationError>
Gracefully shutdown the application
Sourcepub fn request_shutdown(&self)
pub fn request_shutdown(&self)
Request shutdown (can be called from signal handlers)
Sourcepub fn shutdown_requested(&self) -> bool
pub fn shutdown_requested(&self) -> bool
Check if shutdown has been requested
Auto Trait Implementations§
impl Freeze for Application
impl !RefUnwindSafe for Application
impl Send for Application
impl Sync for Application
impl Unpin for Application
impl !UnwindSafe for Application
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