pub struct Application { /* private fields */ }
Expand description
The main application struct that manages the entire web application
Implementations§
Source§impl Application
impl Application
Sourcepub fn with_config(config: Config) -> Self
pub fn with_config(config: Config) -> Self
Creates a new application with custom configuration
Sourcepub fn router(&mut self) -> &mut Router
pub fn router(&mut self) -> &mut Router
Gets a mutable reference to the router for route registration
Sourcepub async fn serve(&mut self, addr: SocketAddr) -> Result<()>
pub async fn serve(&mut self, addr: SocketAddr) -> Result<()>
Starts the HTTP server
Sourcepub async fn serve_default(&mut self) -> Result<()>
pub async fn serve_default(&mut self) -> Result<()>
Convenience method to serve on default address
Sourcepub fn set_config(&mut self, config: Config)
pub fn set_config(&mut self, config: Config)
Updates the application configuration
Trait Implementations§
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