pub struct ScopeSet { /* private fields */ }
Expand description
Represents a set of scopes available with a specific bearer auth key
Implementations§
Source§impl ScopeSet
impl ScopeSet
Sourcepub fn set(&mut self, bit: usize, val: bool) -> bool
pub fn set(&mut self, bit: usize, val: bool) -> bool
Set a bit for a single scope, returns the old value
Sourcepub fn contains(&self, scope: &str) -> bool
pub fn contains(&self, scope: &str) -> bool
Returns true if the set contains the scope specified
Returns false if it does not or the scope does not exist
let mut scopes = ScopeSet::new();
scopes.set(2, true);
assert!(scopes.contains("bits:read"));
assert!(!scopes.contains("channel:edit:commercial"));
Sourcepub fn iter<'a>(&'a self) -> ScopesIter<'a> ⓘ
pub fn iter<'a>(&'a self) -> ScopesIter<'a> ⓘ
Get an iterator over scopes idents iterator
Sourcepub fn ident_to(a: &usize) -> Option<&'static str>
pub fn ident_to(a: &usize) -> Option<&'static str>
Identity function for converting between scope internal number and twitch token string
Sourcepub fn ident_from(b: &str) -> Option<&'static usize>
pub fn ident_from(b: &str) -> Option<&'static usize>
Identity function for converting between scope internal number and twitch token string
Trait Implementations§
Source§impl<'a> FromIterator<&'a str> for ScopeSet
impl<'a> FromIterator<&'a str> for ScopeSet
Auto Trait Implementations§
impl Freeze for ScopeSet
impl RefUnwindSafe for ScopeSet
impl Send for ScopeSet
impl Sync for ScopeSet
impl Unpin for ScopeSet
impl UnwindSafe for ScopeSet
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