Struct utoipa_swagger_ui::Url

source ·
#[non_exhaustive]
pub struct Url<'a> { /* private fields */ }
Expand description

Rust type for Swagger UI url configuration object.

Implementations§

Create new Url.

Name is shown in the select dropdown when there are multiple docs in Swagger UI.

Url is path which exposes the OpenAPI doc.

Examples
let url = Url::new("My Api", "/api-doc/openapi.json");

Create new Url with primary flag.

Primary flag allows users to override the default behavior of the Swagger UI for selecting the primary doc to display. By default when there are multiple docs in Swagger UI the first one in the list will be the primary.

Name is shown in the select dropdown when there are multiple docs in Swagger UI.

Url is path which exposes the OpenAPI doc.

Examples

Set “My Api” as primary.

let url = Url::with_primary("My Api", "/api-doc/openapi.json", true);

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
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Serialize this value into the given Serde serializer. 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