Skip to main content

Application

Trait Application 

Source
pub trait Application {
    // Required method
    fn execute(
        &self,
        request: &Request,
        connection: &ConnectionInfo,
    ) -> Result<Response, String>;
}
Expand description

Dispatch trait that wires controllers into a request-handling loop.

Implement this to define which controllers run and in what order. Pass the implementation to [Server::run] or [Server::run_tls].

The built-in App implementation covers static files, favicons, forms, and file uploads. Embed it or replace it entirely.

Required Methods§

Source

fn execute( &self, request: &Request, connection: &ConnectionInfo, ) -> Result<Response, String>

Receives a parsed request and returns a fully-built response. Walk your controller list with is_matching / process and return the first match.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§