pub struct InfoBuilder { /* private fields */ }
Expand description
Builder for Info
with chainable configuration methods to create a new Info
.
§Examples
Create Info
using InfoBuilder
.
let info = InfoBuilder::new()
.title("My api")
.version("1.0.0")
.contact(Some(ContactBuilder::new()
.name(Some("Admin Admin"))
.email(Some("amdin@petapi.com"))
.build()
))
.build();
Implementations§
Source§impl InfoBuilder
impl InfoBuilder
Sourcepub fn new() -> InfoBuilder
pub fn new() -> InfoBuilder
Constructs a new InfoBuilder
.
Source§impl InfoBuilder
impl InfoBuilder
Sourcepub fn title<I>(self, title: I) -> InfoBuilder
pub fn title<I>(self, title: I) -> InfoBuilder
Add title of the API.
Sourcepub fn version<I>(self, version: I) -> InfoBuilder
pub fn version<I>(self, version: I) -> InfoBuilder
Add version of the api document typically the API version.
Sourcepub fn description<S>(self, description: Option<S>) -> InfoBuilder
pub fn description<S>(self, description: Option<S>) -> InfoBuilder
Add description of the API.
Sourcepub fn terms_of_service<S>(self, terms_of_service: Option<S>) -> InfoBuilder
pub fn terms_of_service<S>(self, terms_of_service: Option<S>) -> InfoBuilder
Add url for terms of the API.
Sourcepub fn contact(self, contact: Option<Contact>) -> InfoBuilder
pub fn contact(self, contact: Option<Contact>) -> InfoBuilder
Add contact information of the API.
Sourcepub fn license(self, license: Option<License>) -> InfoBuilder
pub fn license(self, license: Option<License>) -> InfoBuilder
Add license of the API.
Sourcepub fn extensions(self, extensions: Option<Extensions>) -> InfoBuilder
pub fn extensions(self, extensions: Option<Extensions>) -> InfoBuilder
Add openapi extensions (x-something) of the API.
Trait Implementations§
Source§impl Default for InfoBuilder
impl Default for InfoBuilder
Source§fn default() -> InfoBuilder
fn default() -> InfoBuilder
Returns the “default value” for a type. Read more
Source§impl From<Info> for InfoBuilder
impl From<Info> for InfoBuilder
Source§fn from(value: Info) -> InfoBuilder
fn from(value: Info) -> InfoBuilder
Converts to this type from the input type.
Source§impl From<InfoBuilder> for Info
impl From<InfoBuilder> for Info
Source§fn from(value: InfoBuilder) -> Info
fn from(value: InfoBuilder) -> Info
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for InfoBuilder
impl RefUnwindSafe for InfoBuilder
impl Send for InfoBuilder
impl Sync for InfoBuilder
impl Unpin for InfoBuilder
impl UnwindSafe for InfoBuilder
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