pub struct APIDocs { /* private fields */ }
Implementations§
Source§impl APIDocs
impl APIDocs
pub fn new(config: Option<Config>) -> Self
pub fn add_route_info(&mut self, route: RouteInfo)
pub fn get_config(&self) -> &Config
pub fn add_route( &mut self, method: &str, path: &str, handler: Box<dyn Any + Send + Sync>, summary: Option<String>, description: Option<String>, parameters: Option<Vec<Parameter>>, request_body: Option<RequestBody>, responses: Option<HashMap<String, ApiResponse>>, )
pub fn generate(&mut self) -> Result<()>
pub fn get_documentation(&self) -> &Documentation
pub async fn get_openapi_json(&mut self) -> Result<Value>
pub async fn get_openapi_yaml(&mut self) -> Result<String>
pub async fn get_api_context(&mut self) -> Result<String>
pub fn router(&self) -> Router
Trait Implementations§
Auto Trait Implementations§
impl Freeze for APIDocs
impl !RefUnwindSafe for APIDocs
impl Send for APIDocs
impl Sync for APIDocs
impl Unpin for APIDocs
impl !UnwindSafe for APIDocs
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more