Struct dropshot::OpenApiDefinition [−][src]
This object is used to specify configuration for building an OpenAPI
definition document. It is constructed using ApiDescription::openapi()
.
Additional optional properties may be added and then the OpenAPI definition
document may be generated via write()
or
json()
.
Implementations
impl<'a> OpenApiDefinition<'a>
[src]
pub fn description<S: AsRef<str>>(&mut self, description: S) -> &mut Self
[src]
Provide a short description of the API. CommonMark syntax may be used for rich text representation.
This routine will set the description
field of the Info
object in the
OpenAPI definition.
pub fn terms_of_service<S: AsRef<str>>(&mut self, url: S) -> &mut Self
[src]
Include a Terms of Service URL for the API. Must be in the format of a URL.
This routine will set the termsOfService
field of the Info
object in
the OpenAPI definition.
pub fn contact_name<S: AsRef<str>>(&mut self, name: S) -> &mut Self
[src]
Set the identifying name of the contact person or organisation responsible for the API.
This routine will set the name
property of the Contact
object within
the Info
object in the OpenAPI definition.
pub fn contact_url<S: AsRef<str>>(&mut self, url: S) -> &mut Self
[src]
Set a contact URL for the API. Must be in the format of a URL.
This routine will set the url
property of the Contact
object within
the Info
object in the OpenAPI definition.
pub fn contact_email<S: AsRef<str>>(&mut self, email: S) -> &mut Self
[src]
Set the email address of the contact person or organisation responsible for the API. Must be in the format of an email address.
This routine will set the email
property of the Contact
object within
the Info
object in the OpenAPI definition.
pub fn license<S1, S2>(&mut self, name: S1, url: S2) -> &mut Self where
S1: AsRef<str>,
S2: AsRef<str>,
[src]
S1: AsRef<str>,
S2: AsRef<str>,
Provide the name of the licence used for the API, and a URL (must be in URL format) displaying the licence text.
This routine will set the name
and optional url
properties of the
License
object within the Info
object in the OpenAPI definition.
pub fn license_name<S: AsRef<str>>(&mut self, name: S) -> &mut Self
[src]
Provide the name of the licence used for the API.
This routine will set the name
property of the License object within
the Info
object in the OpenAPI definition.
pub fn json(&self) -> Result<Value>
[src]
Build a JSON object containing the OpenAPI definition for this API.
pub fn write(&self, out: &mut dyn Write) -> Result<()>
[src]
Build a JSON object containing the OpenAPI definition for this API and write it to the provided stream.
Auto Trait Implementations
impl<'a> !RefUnwindSafe for OpenApiDefinition<'a>
[src]
impl<'a> Send for OpenApiDefinition<'a>
[src]
impl<'a> Sync for OpenApiDefinition<'a>
[src]
impl<'a> Unpin for OpenApiDefinition<'a>
[src]
impl<'a> !UnwindSafe for OpenApiDefinition<'a>
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T> Instrument for T
[src]
pub fn instrument(self, span: Span) -> Instrumented<Self>
[src]
pub fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T> Instrument for T
[src]
pub fn instrument(self, span: Span) -> Instrumented<Self>
[src]
pub fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,