pub struct Scopes { /* private fields */ }
Expand description
OAuth2
flow scopes object defines required permissions for oauh 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 mutliple 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
sourceimpl<'de> Deserialize<'de> for Scopes
impl<'de> Deserialize<'de> for Scopes
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
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
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<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
🔬 This is a nightly-only experimental API. (
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more