Struct Config

Source
#[non_exhaustive]
pub struct Config {
Show 26 fields pub config_url: Option<String>, pub dom_id: Option<String>, pub url: Option<String>, pub urls_primary_name: Option<String>, pub urls: Vec<Url>, pub query_config_enabled: Option<bool>, pub deep_linking: Option<bool>, pub display_operation_id: Option<bool>, pub default_models_expand_depth: Option<isize>, pub default_model_expand_depth: Option<isize>, pub default_model_rendering: Option<String>, pub display_request_duration: Option<bool>, pub doc_expansion: Option<String>, pub filter: Option<bool>, pub max_displayed_tags: Option<usize>, pub show_extensions: Option<bool>, pub show_common_extensions: Option<bool>, pub try_it_out_enabled: Option<bool>, pub request_snippets_enabled: Option<bool>, pub oauth2_redirect_url: Option<String>, pub show_mutated_request: Option<bool>, pub supported_submit_methods: Option<Vec<String>>, pub validator_url: Option<String>, pub with_credentials: Option<bool>, pub persist_authorization: Option<bool>, pub layout: String,
}

Fields (Non-exhaustive)§

This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.
§config_url: Option<String>

Url to fetch external configuration from.

§dom_id: Option<String>

Id of the DOM element where Swagger UI will put it’s user interface.

§url: Option<String>

Url the Swagger UI is serving.

§urls_primary_name: Option<String>

Name of the primary url if any.

§urls: Vec<Url>

Urls the Swagger UI is serving.

§query_config_enabled: Option<bool>

Enables overriding configuration parameters with url query parameters.

§deep_linking: Option<bool>

Controls whether deep linking is enabled in OpenAPI spec.

Deep linking automatically scrolls and expands UI to given url fragment.

§display_operation_id: Option<bool>

Controls whether operation id is shown in the operation list.

§default_models_expand_depth: Option<isize>

Default models expansion depth; -1 will completely hide the models.

§default_model_expand_depth: Option<isize>

Default model expansion depth from model example section.

§default_model_rendering: Option<String>

Defines how models is show when API is first rendered.

§display_request_duration: Option<bool>

Define whether request duration in milliseconds is displayed for “Try it out” requests.

§doc_expansion: Option<String>

Controls default expansion for operations and tags.

§filter: Option<bool>

Defines is filtering of tagged operations allowed with edit box in top bar.

§max_displayed_tags: Option<usize>

Controls how many tagged operations are shown. By default all operations are shown.

§show_extensions: Option<bool>

Defines whether extensions are shown.

§show_common_extensions: Option<bool>

Defines whether common extensions are shown.

§try_it_out_enabled: Option<bool>

Defines whether “Try it out” section should be enabled by default.

§request_snippets_enabled: Option<bool>

Defines whether request snippets section is enabled. If disabled legacy curl snipped will be used.

§oauth2_redirect_url: Option<String>

Oauth redirect url.

§show_mutated_request: Option<bool>

Defines whether request mutated with requestInterceptor will be used to produce curl command in the UI.

§supported_submit_methods: Option<Vec<String>>

Define supported http request submit methods.

§validator_url: Option<String>

Define validator url which is used to validate the Swagger spec. By default the validator swagger.io’s online validator is used. Setting this to none will disable spec validation.

§with_credentials: Option<bool>

Enables passing credentials to CORS requests as defined fetch standards.

§persist_authorization: Option<bool>

Defines whether authorizations is persisted throughout browser refresh and close.

§layout: String

The layout of Swagger UI uses, default is "StandaloneLayout"

Implementations§

Source§

impl Config

Source

pub fn url<U: Into<Url>>(&mut self, u: U) -> &mut Self

Trait Implementations§

Source§

impl Clone for Config

Source§

fn clone(&self) -> Config

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Config

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for Config

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl Serialize for Config

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

§

impl Freeze for Config

§

impl RefUnwindSafe for Config

§

impl Send for Config

§

impl Sync for Config

§

impl Unpin for Config

§

impl UnwindSafe for Config

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

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

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

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

fn clone_into(&self, target: &mut T)

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

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.