poem_openapi

Trait OpenApi

Source
pub trait OpenApi: Sized {
    // Required methods
    fn meta() -> Vec<MetaApi>;
    fn register(registry: &mut Registry);
    fn add_routes(
        self,
        route_table: &mut HashMap<String, HashMap<Method, BoxEndpoint<'static>>>,
    );
}
Expand description

Represents an OpenAPI object.

Required Methods§

Source

fn meta() -> Vec<MetaApi>

Gets metadata of this API object.

Source

fn register(registry: &mut Registry)

Register some types to the registry.

Source

fn add_routes( self, route_table: &mut HashMap<String, HashMap<Method, BoxEndpoint<'static>>>, )

Adds all API endpoints to the routing object.

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.

Implementations on Foreign Types§

Source§

impl OpenApi for ()

Source§

fn meta() -> Vec<MetaApi>

Source§

fn register(_registry: &mut Registry)

Source§

fn add_routes( self, _route_table: &mut HashMap<String, HashMap<Method, BoxEndpoint<'static>>>, )

Source§

impl<T1: OpenApi, T2: OpenApi> OpenApi for (T1, T2)

Source§

fn meta() -> Vec<MetaApi>

Source§

fn register(registry: &mut Registry)

Source§

fn add_routes( self, route_table: &mut HashMap<String, HashMap<Method, BoxEndpoint<'static>>>, )

Source§

impl<T1: OpenApi, T2: OpenApi, T3: OpenApi> OpenApi for (T1, T2, T3)

Source§

fn meta() -> Vec<MetaApi>

Source§

fn register(registry: &mut Registry)

Source§

fn add_routes( self, route_table: &mut HashMap<String, HashMap<Method, BoxEndpoint<'static>>>, )

Source§

impl<T1: OpenApi, T2: OpenApi, T3: OpenApi, T4: OpenApi> OpenApi for (T1, T2, T3, T4)

Source§

fn meta() -> Vec<MetaApi>

Source§

fn register(registry: &mut Registry)

Source§

fn add_routes( self, route_table: &mut HashMap<String, HashMap<Method, BoxEndpoint<'static>>>, )

Source§

impl<T1: OpenApi, T2: OpenApi, T3: OpenApi, T4: OpenApi, T5: OpenApi> OpenApi for (T1, T2, T3, T4, T5)

Source§

fn meta() -> Vec<MetaApi>

Source§

fn register(registry: &mut Registry)

Source§

fn add_routes( self, route_table: &mut HashMap<String, HashMap<Method, BoxEndpoint<'static>>>, )

Source§

impl<T1: OpenApi, T2: OpenApi, T3: OpenApi, T4: OpenApi, T5: OpenApi, T6: OpenApi> OpenApi for (T1, T2, T3, T4, T5, T6)

Source§

fn meta() -> Vec<MetaApi>

Source§

fn register(registry: &mut Registry)

Source§

fn add_routes( self, route_table: &mut HashMap<String, HashMap<Method, BoxEndpoint<'static>>>, )

Source§

impl<T1: OpenApi, T2: OpenApi, T3: OpenApi, T4: OpenApi, T5: OpenApi, T6: OpenApi, T7: OpenApi> OpenApi for (T1, T2, T3, T4, T5, T6, T7)

Source§

fn meta() -> Vec<MetaApi>

Source§

fn register(registry: &mut Registry)

Source§

fn add_routes( self, route_table: &mut HashMap<String, HashMap<Method, BoxEndpoint<'static>>>, )

Source§

impl<T1: OpenApi, T2: OpenApi, T3: OpenApi, T4: OpenApi, T5: OpenApi, T6: OpenApi, T7: OpenApi, T8: OpenApi> OpenApi for (T1, T2, T3, T4, T5, T6, T7, T8)

Source§

fn meta() -> Vec<MetaApi>

Source§

fn register(registry: &mut Registry)

Source§

fn add_routes( self, route_table: &mut HashMap<String, HashMap<Method, BoxEndpoint<'static>>>, )

Source§

impl<T1: OpenApi, T2: OpenApi, T3: OpenApi, T4: OpenApi, T5: OpenApi, T6: OpenApi, T7: OpenApi, T8: OpenApi, T9: OpenApi> OpenApi for (T1, T2, T3, T4, T5, T6, T7, T8, T9)

Source§

fn meta() -> Vec<MetaApi>

Source§

fn register(registry: &mut Registry)

Source§

fn add_routes( self, route_table: &mut HashMap<String, HashMap<Method, BoxEndpoint<'static>>>, )

Source§

impl<T1: OpenApi, T2: OpenApi, T3: OpenApi, T4: OpenApi, T5: OpenApi, T6: OpenApi, T7: OpenApi, T8: OpenApi, T9: OpenApi, T10: OpenApi> OpenApi for (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10)

Source§

fn meta() -> Vec<MetaApi>

Source§

fn register(registry: &mut Registry)

Source§

fn add_routes( self, route_table: &mut HashMap<String, HashMap<Method, BoxEndpoint<'static>>>, )

Source§

impl<T1: OpenApi, T2: OpenApi, T3: OpenApi, T4: OpenApi, T5: OpenApi, T6: OpenApi, T7: OpenApi, T8: OpenApi, T9: OpenApi, T10: OpenApi, T11: OpenApi> OpenApi for (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11)

Source§

fn meta() -> Vec<MetaApi>

Source§

fn register(registry: &mut Registry)

Source§

fn add_routes( self, route_table: &mut HashMap<String, HashMap<Method, BoxEndpoint<'static>>>, )

Source§

impl<T1: OpenApi, T2: OpenApi, T3: OpenApi, T4: OpenApi, T5: OpenApi, T6: OpenApi, T7: OpenApi, T8: OpenApi, T9: OpenApi, T10: OpenApi, T11: OpenApi, T12: OpenApi> OpenApi for (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12)

Source§

fn meta() -> Vec<MetaApi>

Source§

fn register(registry: &mut Registry)

Source§

fn add_routes( self, route_table: &mut HashMap<String, HashMap<Method, BoxEndpoint<'static>>>, )

Source§

impl<T1: OpenApi, T2: OpenApi, T3: OpenApi, T4: OpenApi, T5: OpenApi, T6: OpenApi, T7: OpenApi, T8: OpenApi, T9: OpenApi, T10: OpenApi, T11: OpenApi, T12: OpenApi, T13: OpenApi> OpenApi for (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13)

Source§

fn meta() -> Vec<MetaApi>

Source§

fn register(registry: &mut Registry)

Source§

fn add_routes( self, route_table: &mut HashMap<String, HashMap<Method, BoxEndpoint<'static>>>, )

Source§

impl<T1: OpenApi, T2: OpenApi, T3: OpenApi, T4: OpenApi, T5: OpenApi, T6: OpenApi, T7: OpenApi, T8: OpenApi, T9: OpenApi, T10: OpenApi, T11: OpenApi, T12: OpenApi, T13: OpenApi, T14: OpenApi> OpenApi for (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14)

Source§

fn meta() -> Vec<MetaApi>

Source§

fn register(registry: &mut Registry)

Source§

fn add_routes( self, route_table: &mut HashMap<String, HashMap<Method, BoxEndpoint<'static>>>, )

Source§

impl<T1: OpenApi, T2: OpenApi, T3: OpenApi, T4: OpenApi, T5: OpenApi, T6: OpenApi, T7: OpenApi, T8: OpenApi, T9: OpenApi, T10: OpenApi, T11: OpenApi, T12: OpenApi, T13: OpenApi, T14: OpenApi, T15: OpenApi> OpenApi for (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15)

Source§

fn meta() -> Vec<MetaApi>

Source§

fn register(registry: &mut Registry)

Source§

fn add_routes( self, route_table: &mut HashMap<String, HashMap<Method, BoxEndpoint<'static>>>, )

Source§

impl<T1: OpenApi, T2: OpenApi, T3: OpenApi, T4: OpenApi, T5: OpenApi, T6: OpenApi, T7: OpenApi, T8: OpenApi, T9: OpenApi, T10: OpenApi, T11: OpenApi, T12: OpenApi, T13: OpenApi, T14: OpenApi, T15: OpenApi, T16: OpenApi> OpenApi for (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16)

Source§

fn meta() -> Vec<MetaApi>

Source§

fn register(registry: &mut Registry)

Source§

fn add_routes( self, route_table: &mut HashMap<String, HashMap<Method, BoxEndpoint<'static>>>, )

Implementors§