Struct utoipa::openapi::info::InfoBuilder
source · 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 version<I: Into<String>>(self, version: I) -> Self
pub fn version<I: Into<String>>(self, version: I) -> Self
Add version of the api document typically the API version.
sourcepub fn description<S: Into<String>>(self, description: Option<S>) -> Self
pub fn description<S: Into<String>>(self, description: Option<S>) -> Self
Add description of the API.
sourcepub fn terms_of_service<S: Into<String>>(
self,
terms_of_service: Option<S>
) -> Self
pub fn terms_of_service<S: Into<String>>( self, terms_of_service: Option<S> ) -> Self
Add url for terms of the API.
Trait Implementations§
source§impl Default for InfoBuilder
impl Default for InfoBuilder
source§impl From<Info> for InfoBuilder
impl From<Info> for InfoBuilder
source§impl From<InfoBuilder> for Info
impl From<InfoBuilder> for Info
source§fn from(value: InfoBuilder) -> Self
fn from(value: InfoBuilder) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
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