pub struct SecurityRequirement(pub Map<Vec<String>>);Expand description
The security schemes that must be satisfied to invoke an operation.
Each key names a scheme in
Components::security_schemes; the
value lists the required scopes, which is meaningful only for oauth2 and
openIdConnect. All entries in one requirement must be satisfied together;
a list of requirements is satisfied when any one of them is.
An empty requirement means anonymous access is permitted.
This object carries no extensions: the specification does not permit them.
Tuple Fields§
§0: Map<Vec<String>>Implementations§
Source§impl SecurityRequirement
impl SecurityRequirement
Sourcepub fn scoped(
name: impl Into<String>,
scopes: impl IntoIterator<Item = impl Into<String>>,
) -> Self
pub fn scoped( name: impl Into<String>, scopes: impl IntoIterator<Item = impl Into<String>>, ) -> Self
Requires a scheme together with a set of scopes.
Sourcepub fn and(
self,
name: impl Into<String>,
scopes: impl IntoIterator<Item = impl Into<String>>,
) -> Self
pub fn and( self, name: impl Into<String>, scopes: impl IntoIterator<Item = impl Into<String>>, ) -> Self
Adds another scheme that must be satisfied alongside the existing ones.
Sourcepub fn is_anonymous(&self) -> bool
pub fn is_anonymous(&self) -> bool
Returns true when this requirement permits anonymous access.
Trait Implementations§
Source§impl Clone for SecurityRequirement
impl Clone for SecurityRequirement
Source§impl Debug for SecurityRequirement
impl Debug for SecurityRequirement
Source§impl Default for SecurityRequirement
impl Default for SecurityRequirement
Source§impl<'de> Deserialize<'de> for SecurityRequirement
impl<'de> Deserialize<'de> for SecurityRequirement
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
impl Eq for SecurityRequirement
Source§impl PartialEq for SecurityRequirement
impl PartialEq for SecurityRequirement
Source§impl Serialize for SecurityRequirement
impl Serialize for SecurityRequirement
impl StructuralPartialEq for SecurityRequirement
Auto Trait Implementations§
impl Freeze for SecurityRequirement
impl RefUnwindSafe for SecurityRequirement
impl Send for SecurityRequirement
impl Sync for SecurityRequirement
impl Unpin for SecurityRequirement
impl UnsafeUnpin for SecurityRequirement
impl UnwindSafe for SecurityRequirement
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.