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
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§unsafe fn clone_to_uninit(&self, dst: *mut T)
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.