pub struct SecurityScheme {
pub scheme_type: SecuritySchemeType,
pub description: Option<String>,
pub name: Option<String>,
pub location: Option<ApiKeyLocation>,
pub scheme: Option<String>,
pub bearer_format: Option<String>,
pub flows: Option<OAuthFlows>,
pub open_id_connect_url: Option<String>,
}Expand description
安全方案
Fields§
§scheme_type: SecuritySchemeType安全方案类型
description: Option<String>安全方案描述
name: Option<String>API Key 名称(仅 apiKey 类型)
location: Option<ApiKeyLocation>API Key 位置(仅 apiKey 类型)
scheme: Option<String>HTTP 方案名称(仅 http 类型)
bearer_format: Option<String>HTTP Bearer 格式(仅 http 类型)
flows: Option<OAuthFlows>OAuth2 流程(仅 oauth2 类型)
open_id_connect_url: Option<String>OpenID Connect URL(仅 openIdConnect 类型)
Implementations§
Source§impl SecurityScheme
impl SecurityScheme
Sourcepub fn api_key(name: impl Into<String>, location: ApiKeyLocation) -> Self
pub fn api_key(name: impl Into<String>, location: ApiKeyLocation) -> Self
创建 API Key 安全方案
Sourcepub fn oauth2(flows: OAuthFlows) -> Self
pub fn oauth2(flows: OAuthFlows) -> Self
创建 OAuth2 安全方案
Sourcepub fn open_id_connect(url: impl Into<String>) -> Self
pub fn open_id_connect(url: impl Into<String>) -> Self
创建 OpenID Connect 安全方案
Sourcepub fn description(self, desc: impl Into<String>) -> Self
pub fn description(self, desc: impl Into<String>) -> Self
设置描述
Trait Implementations§
Source§impl Clone for SecurityScheme
impl Clone for SecurityScheme
Source§fn clone(&self) -> SecurityScheme
fn clone(&self) -> SecurityScheme
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for SecurityScheme
impl Debug for SecurityScheme
Source§impl<'de> Deserialize<'de> for SecurityScheme
impl<'de> Deserialize<'de> for SecurityScheme
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for SecurityScheme
impl RefUnwindSafe for SecurityScheme
impl Send for SecurityScheme
impl Sync for SecurityScheme
impl Unpin for SecurityScheme
impl UnsafeUnpin for SecurityScheme
impl UnwindSafe for SecurityScheme
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more