Struct rweb::openapi::ComponentDescriptor[][src]

pub struct ComponentDescriptor { /* fields omitted */ }

Implementations

Get a reference to the component named name, if such exists.

Get a reference to the schema of a type.

If schema is inline, it itself is returned, otherwise the component is looked up by name and its schema is returned.

Panics

Panics if schema refers to a non-existing component.

Describes a component, iff it isn’t already described.

Parameters
  • name: name of the component
  • desc: descriptor function
Returns

Reference to the component

Circular references

To avoid infinite recursion on circular references, a blanket schema is stored under component name first, then the component is described and the schema replaced.

Note that this may cause invalid spec generation if somewhere in such loop there are types that rely on cloned modification of the schema of underlying component.

Trait Implementations

Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Performs the conversion.

Should always be Self

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more