Struct rocket_okapi::rapidoc::LayoutConfig
source · [−]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
.
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
sourceimpl Clone for LayoutConfig
impl Clone for LayoutConfig
sourcefn clone(&self) -> LayoutConfig
fn clone(&self) -> LayoutConfig
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 Debug for LayoutConfig
impl Debug for LayoutConfig
Auto Trait Implementations
impl RefUnwindSafe for LayoutConfig
impl Send for LayoutConfig
impl Sync for LayoutConfig
impl Unpin for LayoutConfig
impl UnwindSafe for LayoutConfig
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> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
impl<T> IntoCollection<T> for T
impl<T> IntoCollection<T> for T
fn into_collection<A>(self) -> SmallVec<A> where
A: Array<Item = T>,
fn into_collection<A>(self) -> SmallVec<A> where
A: Array<Item = T>,
Converts self
into a collection.
fn mapped<U, F, A>(self, f: F) -> SmallVec<A> where
F: FnMut(T) -> U,
A: Array<Item = U>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
fn vzip(self) -> V
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more