Struct utoipa_swagger_ui::Config
source · [−]#[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
sourceimpl<'a> Config<'a>
impl<'a> Config<'a>
sourcepub fn new<I: IntoIterator<Item = U>, U: Into<Url<'a>>>(urls: I) -> Self
pub fn new<I: IntoIterator<Item = U>, U: Into<Url<'a>>>(urls: I) -> Self
sourcepub fn with_oauth_config<I: IntoIterator<Item = U>, U: Into<Url<'a>>>(
urls: I,
oauth_config: Config
) -> Self
pub fn with_oauth_config<I: IntoIterator<Item = U>, U: Into<Url<'a>>>(
urls: I,
oauth_config: Config
) -> Self
Trait Implementations
Auto Trait Implementations
impl<'a> RefUnwindSafe for Config<'a>
impl<'a> Send for Config<'a>
impl<'a> Sync for Config<'a>
impl<'a> Unpin for Config<'a>
impl<'a> UnwindSafe for Config<'a>
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