[][src]Struct dropshot::ApiDescription

pub struct ApiDescription { /* fields omitted */ }

An ApiDescription represents the endpoints and handler functions in your API. Other metadata could also be provided here. This object can be used to generate an OpenAPI spec or to run an HTTP server implementing the API.

Implementations

impl ApiDescription[src]

pub fn new() -> Self[src]

pub fn register<T>(&mut self, endpoint: T) -> Result<(), String> where
    T: Into<ApiEndpoint>, 
[src]

Register a new API endpoint.

pub fn print_openapi(
    &self,
    out: &mut dyn Write,
    title: &dyn ToString,
    description: Option<&dyn ToString>,
    terms_of_service: Option<&dyn ToString>,
    contact_name: Option<&dyn ToString>,
    contact_url: Option<&dyn ToString>,
    contact_email: Option<&dyn ToString>,
    license_name: Option<&dyn ToString>,
    license_url: Option<&dyn ToString>,
    version: &dyn ToString
) -> Result<()>
[src]

Emit the OpenAPI Spec document describing this API in its JSON form.

pub fn into_router(self) -> HttpRouter[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,