[−][src]Struct elefren::scopes::Scopes
Represents a set of OAuth scopes
Example
use elefren::prelude::*; let read = Scopes::read_all(); let write = Scopes::write_all(); let follow = Scopes::follow(); let all = read | write | follow;
Methods
impl Scopes
[src]
pub fn all() -> Scopes
[src]
Represents all available oauth scopes: "read write follow push"
use elefren::scopes::Scopes; let scope = Scopes::all(); assert_eq!(&format!("{}", scope), "read write follow push");
pub fn read_all() -> Scopes
[src]
Represents the full "read" scope
use elefren::scopes::Scopes; let scope = Scopes::read_all(); assert_eq!(&format!("{}", scope), "read");
pub fn read(subscope: Read) -> Scopes
[src]
Represents a specific "read:___" scope
use elefren::scopes::{Read, Scopes}; let scope = Scopes::read(Read::Accounts); assert_eq!(&format!("{}", scope), "read:accounts");
pub fn write_all() -> Scopes
[src]
Represents the full "write" scope
use elefren::scopes::Scopes; let scope = Scopes::write_all(); assert_eq!(&format!("{}", scope), "write");
pub fn write(subscope: Write) -> Scopes
[src]
Represents a specific "write:___" scope
use elefren::scopes::{Scopes, Write}; let scope = Scopes::write(Write::Accounts); assert_eq!(&format!("{}", scope), "write:accounts");
pub fn follow() -> Scopes
[src]
Represents the "follow" scope
use elefren::scopes::Scopes; let scope = Scopes::follow(); assert_eq!(&format!("{}", scope), "follow");
pub fn push() -> Scopes
[src]
Represents the full "push" scope
use elefren::scopes::Scopes; let scope = Scopes::push(); assert_eq!(&format!("{}", scope), "push");
pub fn and(self, other: Scopes) -> Scopes
[src]
Combines 2 scopes together
Example
use elefren::prelude::*; let read = Scopes::read_all(); let write = Scopes::write_all(); let read_write = read.and(write);
Trait Implementations
impl PartialEq<Scopes> for Scopes
[src]
fn eq(&self, other: &Scopes) -> bool
[src]
#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]
fn ne(&self, other: &Rhs) -> boolThis method tests for !=
.
impl Default for Scopes
[src]
impl Clone for Scopes
[src]
fn clone(&self) -> Scopes
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl Display for Scopes
[src]
impl Debug for Scopes
[src]
impl BitOr<Scopes> for Scopes
[src]
type Output = Scopes
The resulting type after applying the |
operator.
fn bitor(self, other: Scopes) -> Self::Output
[src]
impl FromStr for Scopes
[src]
type Err = Error
The associated error which can be returned from parsing.
fn from_str(s: &str) -> Result<Scopes, Self::Err>
[src]
impl Serialize for Scopes
[src]
Auto Trait Implementations
Blanket Implementations
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Erased for T
impl<'a, T> TryFrom<&'a str> for T where
T: FromStr,
[src]
T: FromStr,
type Err = <T as FromStr>::Err
fn try_from(string: &'a str) -> Result<T, <T as TryFrom<&'a str>>::Err>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,