pub struct BootApplication { /* private fields */ }Expand description
Built application with a resolved module graph and framework-neutral routes.
Implementations§
Source§impl BootApplication
impl BootApplication
Sourcepub fn builder() -> BootApplicationBuilder
pub fn builder() -> BootApplicationBuilder
Create an application builder.
Sourcepub fn module_names(&self) -> &[String]
pub fn module_names(&self) -> &[String]
Names of modules included in the application, in registration order.
Sourcepub fn routes(&self) -> &[RouteDefinition]
pub fn routes(&self) -> &[RouteDefinition]
Routes exposed by the application.
Sourcepub fn route_for(
&self,
method: HttpMethod,
path: &str,
) -> Option<&RouteDefinition>
pub fn route_for( &self, method: HttpMethod, path: &str, ) -> Option<&RouteDefinition>
Route registered for a method and the most specific route shape matching a path.
Sourcepub fn route_match(
&self,
method: HttpMethod,
path: &str,
) -> Result<Option<RouteMatch<'_>>>
pub fn route_match( &self, method: HttpMethod, path: &str, ) -> Result<Option<RouteMatch<'_>>>
Route and decoded path parameters for a method and path, when one is registered.
Sourcepub fn allowed_methods(&self, path: &str) -> Vec<HttpMethod>
pub fn allowed_methods(&self, path: &str) -> Vec<HttpMethod>
HTTP methods registered for the most specific route shape matching a path.
Sourcepub fn allowed_methods_header(&self, path: &str) -> Option<String>
pub fn allowed_methods_header(&self, path: &str) -> Option<String>
Comma-separated HTTP methods for an Allow header on the most specific matching path.
Sourcepub fn module_ref(&self) -> &ModuleRef
pub fn module_ref(&self) -> &ModuleRef
Provider container available to hosts and controllers.
Sourcepub fn get<T>(&self) -> Result<Arc<T>>
pub fn get<T>(&self) -> Result<Arc<T>>
Resolve a typed provider from the application container.
Sourcepub fn get_named<T>(&self, token: &str) -> Result<Arc<T>>
pub fn get_named<T>(&self, token: &str) -> Result<Arc<T>>
Resolve a named provider from the application container.
Sourcepub fn get_optional<T>(&self) -> Result<Option<Arc<T>>>
pub fn get_optional<T>(&self) -> Result<Option<Arc<T>>>
Resolve a typed provider when it is present.
Sourcepub fn get_optional_named<T>(&self, token: &str) -> Result<Option<Arc<T>>>
pub fn get_optional_named<T>(&self, token: &str) -> Result<Option<Arc<T>>>
Resolve a named provider when it is present.
Sourcepub async fn call(&self, request: BootRequest) -> Result<BootResponse>
pub async fn call(&self, request: BootRequest) -> Result<BootResponse>
Dispatch a framework-neutral request through the resolved route table.
Sourcepub async fn handle(&self, request: BootRequest) -> BootResponse
pub async fn handle(&self, request: BootRequest) -> BootResponse
Dispatch a request and convert unhandled errors into Boot HTTP responses.
Sourcepub async fn bootstrap(&self) -> Result<()>
pub async fn bootstrap(&self) -> Result<()>
Run async startup hooks before serving, when the host needs them.
Sourcepub async fn shutdown(&self) -> Result<()>
pub async fn shutdown(&self) -> Result<()>
Run async shutdown hooks in reverse registration order.
Sourcepub fn into_adapter<A>(self, adapter: &A) -> Result<A::Output>where
A: HttpAdapter,
pub fn into_adapter<A>(self, adapter: &A) -> Result<A::Output>where
A: HttpAdapter,
Build this application through a concrete HTTP adapter.
Sourcepub async fn serve_with<A>(self, adapter: &A, addr: SocketAddr) -> Result<()>where
A: HttpAdapter,
pub async fn serve_with<A>(self, adapter: &A, addr: SocketAddr) -> Result<()>where
A: HttpAdapter,
Serve this application through a concrete HTTP adapter.
Trait Implementations§
Source§impl Clone for BootApplication
impl Clone for BootApplication
Source§fn clone(&self) -> BootApplication
fn clone(&self) -> BootApplication
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more