[][src]Struct opg::models::Components

pub struct Components {
    pub schemas: BTreeMap<String, Model>,
    pub security_schemes: BTreeMap<String, SecurityScheme>,
}

Components Object

specification

Fields

schemas: BTreeMap<String, Model>

An object to hold reusable Schema Objects

security_schemes: BTreeMap<String, SecurityScheme>

An object to hold reusable Security Scheme Objects

Implementations

impl Components[src]

pub fn new() -> Self[src]

pub fn contains_model(&self, name: &str) -> bool[src]

Check name occurrence in schemas

pub fn mention_schema<M: ?Sized>(
    &mut self,
    inline: bool,
    params: &ContextParams
) -> ModelReference where
    M: OpgModel
[src]

Insert model into schema and return it's reference

pub fn mention_security_scheme<T>(
    &mut self,
    name: String,
    security_scheme: &T
) -> String where
    T: Clone,
    SecurityScheme: From<T>, 
[src]

Insert security scheme and return it's name

pub fn verify_schemas(&self) -> Result<(), String>[src]

Verify schemas references

pub fn add_model<N>(&mut self, name: N, model: Model) where
    N: ToString
[src]

Manually insert model with specified name

Trait Implementations

impl Clone for Components[src]

impl Debug for Components[src]

impl Default for Components[src]

impl Serialize for Components[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.