pub struct ComponentsBuilder<S: State = Empty> { /* private fields */ }
Expand description
Use builder syntax to set the inputs and finish with build()
.
Implementations§
Source§impl<S: State> ComponentsBuilder<S>
impl<S: State> ComponentsBuilder<S>
Sourcepub fn build(self) -> Componentswhere
S: IsComplete,
pub fn build(self) -> Componentswhere
S: IsComplete,
Finish building and return the requested object
Sourcepub fn extensions(
self,
value: impl Into<Extensions>,
) -> ComponentsBuilder<SetExtensions<S>>where
S::Extensions: IsUnset,
pub fn extensions(
self,
value: impl Into<Extensions>,
) -> ComponentsBuilder<SetExtensions<S>>where
S::Extensions: IsUnset,
Sourcepub fn maybe_extensions(
self,
value: Option<impl Into<Extensions>>,
) -> ComponentsBuilder<SetExtensions<S>>where
S::Extensions: IsUnset,
pub fn maybe_extensions(
self,
value: Option<impl Into<Extensions>>,
) -> ComponentsBuilder<SetExtensions<S>>where
S::Extensions: IsUnset,
Source§impl<S: State> ComponentsBuilder<S>
impl<S: State> ComponentsBuilder<S>
Sourcepub fn schema(self, name: impl Into<String>, schema: impl Into<Schema>) -> Self
pub fn schema(self, name: impl Into<String>, schema: impl Into<Schema>) -> Self
Add Schema
to Components
.
Accepts two arguments where first is name of the schema and second is the schema itself.
Sourcepub fn schemas_from_iter<I: IntoIterator<Item = (S2, C)>, C: Into<Schema>, S2: Into<String>>(
self,
schemas: I,
) -> Self
pub fn schemas_from_iter<I: IntoIterator<Item = (S2, C)>, C: Into<Schema>, S2: Into<String>>( self, schemas: I, ) -> Self
Sourcepub fn response<S2: Into<String>, R: Into<RefOr<Response>>>(
self,
name: S2,
response: R,
) -> Self
pub fn response<S2: Into<String>, R: Into<RefOr<Response>>>( self, name: S2, response: R, ) -> Self
Add Response
to Components
.
Method accepts tow arguments; name
of the reusable response and response
which is the
reusable response itself.
Sourcepub fn responses_from_iter<I: IntoIterator<Item = (S2, R)>, S2: Into<String>, R: Into<RefOr<Response>>>(
self,
responses: I,
) -> Self
pub fn responses_from_iter<I: IntoIterator<Item = (S2, R)>, S2: Into<String>, R: Into<RefOr<Response>>>( self, responses: I, ) -> Self
Add multiple Response
s to Components
from iterator.
Like the ComponentsBuilder::schemas_from_iter
this allows adding multiple responses by
any iterator what returns tuples of (name, response) values.
Sourcepub fn security_scheme<N: Into<String>, S2: Into<SecurityScheme>>(
self,
name: N,
security_scheme: S2,
) -> Self
pub fn security_scheme<N: Into<String>, S2: Into<SecurityScheme>>( self, name: N, security_scheme: S2, ) -> 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
.