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 schema<S: Into<String>, I: Into<RefOr<Schema>>>(
self,
name: S,
schema: I
) -> Self
pub fn schema<S: Into<String>, I: Into<RefOr<Schema>>>(
self,
name: S,
schema: I
) -> Self
Add Schema
to Components
.
Accpets two arguments where first is name of the schema and second is the schema itself.
sourcepub fn schemas_from_iter<I: IntoIterator<Item = (S, C)>, C: Into<RefOr<Schema>>, S: Into<String>>(
self,
schemas: I
) -> Self
pub fn schemas_from_iter<I: IntoIterator<Item = (S, C)>, C: Into<RefOr<Schema>>, S: Into<String>>(
self,
schemas: I
) -> Self
pub fn response<S: Into<String>, R: Into<RefOr<Response>>>(
self,
name: S,
response: R
) -> Self
pub fn response_from_into<I: ToResponse>(self) -> Self
pub fn responses_from_iter<I: IntoIterator<Item = (S, R)>, S: Into<String>, R: Into<RefOr<Response>>>(
self,
responses: I
) -> Self
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
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