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
sourceimpl InfoBuilder
impl InfoBuilder
sourcepub fn new() -> InfoBuilder
pub fn new() -> InfoBuilder
Constructs a new InfoBuilder
.
sourceimpl 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
sourceimpl Default for InfoBuilder
impl Default for InfoBuilder
sourceimpl From<Info> for InfoBuilder
impl From<Info> for InfoBuilder
sourceimpl From<InfoBuilder> for Info
impl From<InfoBuilder> for Info
sourcefn 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
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more