use crate::{ resource::*, result::*, routing::* }; use futures::future::ok; use gotham::{ handler::{Handler, HandlerFuture, NewHandler}, helpers::http::response::create_response, pipeline::chain::PipelineHandleChain, router::builder::*, state::State }; use indexmap::IndexMap; use log::error; use mime::{APPLICATION_JSON, TEXT_PLAIN}; use openapiv3::{MediaType, OpenAPI, Operation, PathItem, Paths, ReferenceOr, ReferenceOr::Item, Response, Responses, StatusCode}; use serde::de::DeserializeOwned; use std::panic::RefUnwindSafe; pub struct OpenapiRouter<'a, D> { route : &'a mut D, openapi : OpenAPI } impl<'a, D> OpenapiRouter<'a, D> { pub fn new
+ Copy + Send + Sync + 'static, P : RefUnwindSafe + Send + Sync + 'static { pub fn get_openapi(&mut self, path : &str) { self.route.get(path).to_new_handler(OpenapiHandler::new(&self.openapi)); } } impl<'a, C, P> DrawResources for OpenapiRouter<'a, $implType<'a, C, P>> where C : PipelineHandleChain
+ Copy + Send + Sync + 'static,
P : RefUnwindSafe + Send + Sync + 'static
{
fn resource + Copy + Send + Sync + 'static,
P : RefUnwindSafe + Send + Sync + 'static
{
fn read_all