pub struct Scopes { /* private fields */ }
Expand description
OAuth2
flow scopes object defines required permissions for oauth flow.
Scopes must be given to oauth2 flow but depending on need one of few initialization methods could be used.
- Create empty map of scopes you can use
Scopes::new
. - Create map with only one scope you can use
Scopes::one
. - Create multiple scopes from iterator with
Scopes::from_iter
.
§Examples
Create empty map of scopes.
let scopes = Scopes::new();
Create Scopes
holding one scope.
let scopes = Scopes::one("edit:item", "edit pets");
Create map of scopes from iterator.
let scopes = Scopes::from_iter([
("edit:items", "edit my items"),
("read:items", "read my items")
]);
Implementations§
Trait Implementations§
source§impl<'de> Deserialize<'de> for Scopes
impl<'de> Deserialize<'de> for Scopes
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
source§impl<I> FromIterator<(I, I)> for Scopes
impl<I> FromIterator<(I, I)> for Scopes
source§impl PartialEq for Scopes
impl PartialEq for Scopes
impl Eq for Scopes
impl StructuralPartialEq for Scopes
Auto Trait Implementations§
impl Freeze for Scopes
impl RefUnwindSafe for Scopes
impl Send for Scopes
impl Sync for Scopes
impl Unpin for Scopes
impl UnwindSafe for Scopes
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,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)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.