Trait RequestParser

Source
pub trait RequestParser<B> {
    // Required method
    fn parse_operation_id(req: &Request<B>) -> Result<&'static str, ()>;
}
Expand description

A trait for retrieving swagger-related information from a request.

This allows other middlewares to retrieve API-related information from a request that may not have been handled by the autogenerated API code yet. For example, a statistics tracking service may wish to use this to count requests per-operation.

The trait is automatically implemented by swagger-codegen.

Required Methods§

Source

fn parse_operation_id(req: &Request<B>) -> Result<&'static str, ()>

Retrieve the Swagger operation identifier that matches this request.

Returns Err(()) if this request does not match any known operation on this API.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§