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 PartialEq<Scopes> for Scopes
impl PartialEq<Scopes> for Scopes
impl Eq for Scopes
impl StructuralEq for Scopes
impl StructuralPartialEq for Scopes
Auto Trait Implementations§
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<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.