All Downloads are FREE. Search and download functionalities are using the official Maven repository.

rust-axum.server-route.mustache Maven / Gradle / Ivy

There is a newer version: 7.9.0
Show newest version
/// Setup API Server.
pub fn new(api_impl: I) -> Router
where
    I: AsRef + Clone + Send + Sync + 'static,
    A: {{#apiInfo}}{{#apis}}{{#operations}}apis::{{classFilename}}::{{classnamePascalCase}}{{#havingAuthMethod}}{{/havingAuthMethod}} + {{/operations}}{{/apis}}{{/apiInfo}}{{#authMethods}}{{#isApiKey}}{{#isKeyInCookie}}apis::CookieAuthentication + {{/isKeyInCookie}}{{#isKeyInHeader}}apis::ApiKeyAuthHeader + {{/isKeyInHeader}}{{/isApiKey}}{{/authMethods}}'static,
    {{#havingAuthMethods}}C: Send + Sync + 'static,{{/havingAuthMethods}}
{
    // build our application with a route
    Router::new()
        {{#pathMethodOps}}
        .route("{{{basePathWithoutHost}}}{{{path}}}",
            {{#methodOperations}}{{{method}}}({{{operationID}}}::){{^-last}}.{{/-last}}{{/methodOperations}}
        )
        {{/pathMethodOps}}
        .with_state(api_impl)
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy