Struct aliri_oauth2::oauth2::Scope
source · [−]pub struct Scope(_);
Expand description
An OAuth2 Scope defining a set of access permissions
Implementations
sourceimpl Scope
impl Scope
sourcepub const fn single(scope_token: ScopeToken) -> Self
pub const fn single(scope_token: ScopeToken) -> Self
Constructs a new scope from a single scope token
sourcepub fn and(self, scope_token: ScopeToken) -> Self
pub fn and(self, scope_token: ScopeToken) -> Self
Adds an additional scope token
sourcepub fn from_scope_tokens<I>(scope_tokens: I) -> Self where
I: IntoIterator<Item = ScopeToken>,
pub fn from_scope_tokens<I>(scope_tokens: I) -> Self where
I: IntoIterator<Item = ScopeToken>,
Constructs a scope from an iterator of scope tokens
sourcepub fn insert(&mut self, scope_token: ScopeToken)
pub fn insert(&mut self, scope_token: ScopeToken)
Adds a scope token to the scope
sourcepub fn iter(&self) -> impl Iterator<Item = &ScopeTokenRef>
pub fn iter(&self) -> impl Iterator<Item = &ScopeTokenRef>
Produces an iterator of the scope tokens in this set
sourcepub fn contains_all(&self, subset: &Scope) -> bool
pub fn contains_all(&self, subset: &Scope) -> bool
Checks to see whether this scope contains all of
the scope tokens in subset
.
Trait Implementations
sourceimpl<'de> Deserialize<'de> for Scope
impl<'de> Deserialize<'de> for Scope
sourcefn 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
sourceimpl<S> Extend<S> for Scope where
S: Into<ScopeToken>,
impl<S> Extend<S> for Scope where
S: Into<ScopeToken>,
sourcefn extend<I>(&mut self, iter: I) where
I: IntoIterator<Item = S>,
fn extend<I>(&mut self, iter: I) where
I: IntoIterator<Item = S>,
Extends a collection with the contents of an iterator. Read more
sourcefn extend_one(&mut self, item: A)
fn extend_one(&mut self, item: A)
extend_one
)Extends a collection with exactly one element.
sourcefn extend_reserve(&mut self, additional: usize)
fn extend_reserve(&mut self, additional: usize)
extend_one
)Reserves capacity in a collection for the given number of additional elements. Read more
sourceimpl Extend<Scope> for ScopePolicy
impl Extend<Scope> for ScopePolicy
sourcefn extend<I>(&mut self, iter: I) where
I: IntoIterator<Item = Scope>,
fn extend<I>(&mut self, iter: I) where
I: IntoIterator<Item = Scope>,
Extends a collection with the contents of an iterator. Read more
sourcefn extend_one(&mut self, item: A)
fn extend_one(&mut self, item: A)
extend_one
)Extends a collection with exactly one element.
sourcefn extend_reserve(&mut self, additional: usize)
fn extend_reserve(&mut self, additional: usize)
extend_one
)Reserves capacity in a collection for the given number of additional elements. Read more
sourceimpl From<Scope> for ScopePolicy
impl From<Scope> for ScopePolicy
sourceimpl From<ScopeToken> for Scope
impl From<ScopeToken> for Scope
sourcefn from(t: ScopeToken) -> Self
fn from(t: ScopeToken) -> Self
Converts to this type from the input type.
sourceimpl<S> FromIterator<S> for Scope where
S: Into<ScopeToken>,
impl<S> FromIterator<S> for Scope where
S: Into<ScopeToken>,
sourcefn from_iter<I>(iter: I) -> Self where
I: IntoIterator<Item = S>,
fn from_iter<I>(iter: I) -> Self where
I: IntoIterator<Item = S>,
Creates a value from an iterator. Read more
sourceimpl FromIterator<Scope> for ScopePolicy
impl FromIterator<Scope> for ScopePolicy
sourcefn from_iter<I>(iter: I) -> Self where
I: IntoIterator<Item = Scope>,
fn from_iter<I>(iter: I) -> Self where
I: IntoIterator<Item = Scope>,
Creates a value from an iterator. Read more
sourceimpl IntoIterator for Scope
impl IntoIterator for Scope
sourceimpl<'a> IntoIterator for &'a Scope
impl<'a> IntoIterator for &'a Scope
impl Eq for Scope
impl StructuralEq for Scope
impl StructuralPartialEq for Scope
Auto Trait Implementations
impl RefUnwindSafe for Scope
impl Send for Scope
impl Sync for Scope
impl Unpin for Scope
impl UnwindSafe for Scope
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<Q, K> Equivalent<K> for Q where
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Q where
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
sourcefn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to key
and return true
if they are equal.
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>
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