pub struct ComponentsBuilder { /* private fields */ }
Expand description
Builder for Components
with chainable configuration methods to create a new Components
.
Implementations§
source§impl 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.
source§impl 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
.
Accepts two arguments where first is name of the schema and second is the schema itself.
pub fn schema_from<'s, I: ToSchema<'s>>(self) -> Self
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<'r, I: ToResponse<'r>>(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§
source§impl Default for ComponentsBuilder
impl Default for ComponentsBuilder
source§impl From<Components> for ComponentsBuilder
impl From<Components> for ComponentsBuilder
source§fn from(value: Components) -> Self
fn from(value: Components) -> Self
Converts to this type from the input type.
source§impl From<ComponentsBuilder> for Components
impl From<ComponentsBuilder> for Components
source§fn from(value: ComponentsBuilder) -> Self
fn from(value: ComponentsBuilder) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for ComponentsBuilder
impl RefUnwindSafe for ComponentsBuilder
impl Send for ComponentsBuilder
impl Sync for ComponentsBuilder
impl Unpin for ComponentsBuilder
impl UnwindSafe for ComponentsBuilder
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