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

Object used to alter Swagger UI settings.

Examples

Simple case is to create config directly from url that points to the api doc json.

let config = Config::from("/api-doc.json");

If there is multiple api docs to serve config can be also directly created with Config::new

let config = Config::new(["/api-doc/openapi1.json", "/api-doc/openapi2.json"]);

Or same as above but more verbose syntax.

let config = Config::new([
    Url::new("api1", "/api-doc/openapi1.json"),
    Url::new("api2", "/api-doc/openapi2.json")
]);

With oauth config

let config = Config::with_oauth_config(
    ["/api-doc/openapi1.json", "/api-doc/openapi2.json"],
    oauth::Config::new(),
);

Implementations

Constructs a new Config from Iterator of Urls.

Examples

Create new config with 2 api doc urls.

let config = Config::new(["/api-doc/openapi1.json", "/api-doc/openapi2.json"]);

Constructs a new Config from Iterator of Urls.

Examples

Create new config with oauth config

let config = Config::with_oauth_config(
    ["/api-doc/openapi1.json", "/api-doc/openapi2.json"],
    oauth::Config::new(),
);

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. 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.

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