pub struct LayoutConfig {
    pub layout: Layout,
    pub render_style: RenderStyle,
    pub on_nav_tag_click: NavTagClick,
    pub schema_style: SchemaStyle,
    pub schema_expand_level: u16,
    pub schema_description_expanded: bool,
    pub schema_hide_read_only: SchemaHideReadOnly,
    pub schema_hide_write_only: SchemaHideWriteOnly,
    pub default_schema_tab: DefaultSchemaTab,
    pub response_area_height: String,
}
Expand description

Used to customize the layout of the displayed docs.

Fields

layout: Layout

Layout helps in placement of request/response sections. In column layout, request & response sections are placed one below the other, In row layout they are placed side by side. This attribute is applicable only when the device width is more than 768px and the render-style is ‘view’.

The default is Layout::Row.

render_style: RenderStyle

Determines display of api-docs. Currently there are two modes supported.

  • view friendly for quick exploring (expand/collapse the section of your interest)
  • read suitable for reading (like a continuous web-page)
  • focused similar to read but focuses on a single endpoint at a time (good for large specs)

read is more suitable for reading, view is more friendly for quick exploring.

The default is RenderStyle::View.

on_nav_tag_click: NavTagClick

Applies only to focused render-style. It determines the behavior of clicking on a Tag in navigation bar. It can either expand-collapse the tag or take you to the tag’s description page.

The default is NavTagClick::ExpandCollapse.

schema_style: SchemaStyle

Two different ways to display object-schemas in the responses and request bodies.

The default is SchemaStyle::Tree.

schema_expand_level: u16

Schemas are expanded by default, use this attribute to control how many levels in the schema should be expanded.

The default is 999.

schema_description_expanded: bool

Constraint and descriptions information of fields in the schema are collapsed to show only the first line. Set it to true if you want them to fully expanded.

The default is false.

schema_hide_read_only: SchemaHideReadOnly

Read-only fields in request schemas is always hidden but are shown in response. If you do not want to hide read-only fields or hide them based on action you can configure this setting to ‘never’ or any combination of post | put | patch to indicate where to hide Schemas in response section is not affected by this setting.

The default is SchemaHideReadOnly::Always.

schema_hide_write_only: SchemaHideWriteOnly

Write-only fields in response schemas is always hidden but are shown in request. If you do not want to hide write-only fields then set to ‘never’ Schemas in request section is not affected by this setting.

The default is SchemaHideWriteOnly::Always.

default_schema_tab: DefaultSchemaTab

The schemas are displayed in two tabs - Model and Example. This option allows you to pick the default tab that you would like to be active.

The default is DefaultSchemaTab::Model.

response_area_height: String

Use this value to control the height of response textarea.

Allowed: valid css height value such as 400px, 50%, 60vh, etc. The default is "300px".

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Returns the “default value” for a type. 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

Returns the argument unchanged.

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

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Converts self into a collection.

Should always be Self

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

Uses borrowed data to replace owned data, usually by cloning. Read more

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