#[non_exhaustive]pub struct Components {
pub schemas: HashMap<String, Component>,
pub security_schemes: HashMap<String, SecurityScheme>,
}
Expand description
Implements OpenAPI Components Object which holds supported reusable objects.
Fields (Non-exhaustive)
This struct is marked as non-exhaustive
Struct { .. }
syntax; cannot be matched against without a wildcard ..
; and struct update syntax will not work.schemas: HashMap<String, Component>
Map of reusable OpenAPI Schema Objects.
security_schemes: HashMap<String, SecurityScheme>
Map of reusable OpenAPI Security Schema Objects.
Implementations
sourceimpl Components
impl Components
sourcepub fn new() -> Self
pub fn new() -> Self
Construct a new Components
.
sourcepub fn add_security_scheme<N: Into<String>, S: Into<SecurityScheme>>(
&mut self,
name: N,
security_schema: S
)
pub fn add_security_scheme<N: Into<String>, S: Into<SecurityScheme>>(
&mut self,
name: N,
security_schema: S
)
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
.
sourcepub fn add_security_schemes_from_iter<I: IntoIterator<Item = (N, S)>, N: Into<String>, S: Into<SecurityScheme>>(
&mut self,
schemas: I
)
pub fn add_security_schemes_from_iter<I: IntoIterator<Item = (N, S)>, N: Into<String>, S: Into<SecurityScheme>>(
&mut self,
schemas: I
)
Add iterator of SecurityScheme
s 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 Clone for Components
impl Clone for Components
sourcefn clone(&self) -> Components
fn clone(&self) -> Components
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Default for Components
impl Default for Components
sourcefn default() -> Components
fn default() -> Components
Returns the “default value” for a type. Read more
sourceimpl<'de> Deserialize<'de> for Components
impl<'de> Deserialize<'de> for Components
sourcefn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. 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.
sourceimpl Serialize for Components
impl Serialize for Components
Auto Trait Implementations
impl RefUnwindSafe for Components
impl Send for Components
impl Sync for Components
impl Unpin for Components
impl UnwindSafe for Components
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
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more