pub struct ComponentsBuilder { /* private fields */ }
Expand description
Builder for Components
with chainable configuration methods to create a new Components
.
Implementations
sourceimpl ComponentsBuilder
impl ComponentsBuilder
sourcepub fn new() -> ComponentsBuilder
pub fn new() -> ComponentsBuilder
Constructs a new ComponentsBuilder
.
sourcepub fn build(self) -> Components
pub fn build(self) -> Components
Constructs a new Components
taking all fields values from this object.
sourceimpl ComponentsBuilder
impl ComponentsBuilder
sourcepub fn component<S: Into<String>, I: Into<Component>>(
self,
name: S,
component: I
) -> Self
pub fn component<S: Into<String>, I: Into<Component>>(
self,
name: S,
component: I
) -> Self
Add Component
to Components
.
Accpets two arguments where first is name of the component and second is the component itself.
sourcepub fn security_scheme<N: Into<String>, S: Into<SecurityScheme>>(
self,
name: N,
security_schema: S
) -> Self
pub fn security_scheme<N: Into<String>, S: Into<SecurityScheme>>(
self,
name: N,
security_schema: S
) -> Self
Add SecurityScheme
to Components
.
Accepts two arguments where first is the name of the SecurityScheme
. This is later when
referenced by SecurityRequirement
s. Second parameter is the SecurityScheme
.
Trait Implementations
sourceimpl Default for ComponentsBuilder
impl Default for ComponentsBuilder
sourcefn default() -> ComponentsBuilder
fn default() -> ComponentsBuilder
Returns the “default value” for a type. Read more
sourceimpl From<Components> for ComponentsBuilder
impl From<Components> for ComponentsBuilder
sourcefn from(value: Components) -> Self
fn from(value: Components) -> Self
Converts to this type from the input type.
sourceimpl From<ComponentsBuilder> for Components
impl From<ComponentsBuilder> for Components
sourcefn from(value: ComponentsBuilder) -> Self
fn from(value: ComponentsBuilder) -> Self
Converts to this type from the input type.
Auto Trait Implementations
impl RefUnwindSafe for ComponentsBuilder
impl Send for ComponentsBuilder
impl Sync for ComponentsBuilder
impl Unpin for ComponentsBuilder
impl UnwindSafe for ComponentsBuilder
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