Struct aliri_oauth2::oauth2::Scope[][src]

pub struct Scope(_);
Expand description

An OAuth2 Scope defining a set of access permissions

Implementations

impl Scope[src]

pub fn empty() -> Self[src]

Produces an empty scope

pub fn single(scope_token: ScopeToken) -> Self[src]

Constructs a new scope from a single scope token

pub fn and(self, scope_token: ScopeToken) -> Self[src]

Adds an additional scope token

pub fn from_scope_tokens<I>(scope_tokens: I) -> Self where
    I: IntoIterator<Item = ScopeToken>, 
[src]

Constructs a scope from an iterator of scope tokens

pub fn insert(&mut self, scope_token: ScopeToken)[src]

Adds a scope token to the scope

pub fn iter(&self) -> impl Iterator<Item = &ScopeTokenRef>[src]

Produces an iterator of the scope tokens in this set

pub fn contains_all(&self, subset: &Scope) -> bool[src]

Checks to see whether this scope contains all of the scope tokens in subset.

Trait Implementations

impl Clone for Scope[src]

fn clone(&self) -> Scope[src]

Returns a copy of the value. Read more

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl Debug for Scope[src]

fn fmt(&self, f: &mut Formatter<'_>) -> Result[src]

Formats the value using the given formatter. Read more

impl Default for Scope[src]

fn default() -> Scope[src]

Returns the “default value” for a type. Read more

impl<'de> Deserialize<'de> for Scope[src]

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
    __D: Deserializer<'de>, 
[src]

Deserialize this value from the given Serde deserializer. Read more

impl<S> Extend<S> for Scope where
    S: Into<ScopeToken>, 
[src]

fn extend<I>(&mut self, iter: I) where
    I: IntoIterator<Item = S>, 
[src]

Extends a collection with the contents of an iterator. Read more

fn extend_one(&mut self, item: A)[src]

🔬 This is a nightly-only experimental API. (extend_one)

Extends a collection with exactly one element.

fn extend_reserve(&mut self, additional: usize)[src]

🔬 This is a nightly-only experimental API. (extend_one)

Reserves capacity in a collection for the given number of additional elements. Read more

impl Extend<Scope> for ScopePolicy[src]

fn extend<I>(&mut self, iter: I) where
    I: IntoIterator<Item = Scope>, 
[src]

Extends a collection with the contents of an iterator. Read more

fn extend_one(&mut self, item: A)[src]

🔬 This is a nightly-only experimental API. (extend_one)

Extends a collection with exactly one element.

fn extend_reserve(&mut self, additional: usize)[src]

🔬 This is a nightly-only experimental API. (extend_one)

Reserves capacity in a collection for the given number of additional elements. Read more

impl<S> FromIterator<S> for Scope where
    S: Into<ScopeToken>, 
[src]

fn from_iter<I>(iter: I) -> Self where
    I: IntoIterator<Item = S>, 
[src]

Creates a value from an iterator. Read more

impl FromIterator<Scope> for ScopePolicy[src]

fn from_iter<I>(iter: I) -> Self where
    I: IntoIterator<Item = Scope>, 
[src]

Creates a value from an iterator. Read more

impl FromStr for Scope[src]

type Err = InvalidScopeToken

The associated error which can be returned from parsing.

fn from_str(s: &str) -> Result<Self, Self::Err>[src]

Parses a string s to return a value of this type. Read more

impl HasScope for Scope[src]

fn scope(&self) -> &Scope[src]

OAuth2 scope Read more

impl IntoIterator for Scope[src]

type Item = ScopeToken

The type of the elements being iterated over.

type IntoIter = <AHashSet<ScopeToken> as IntoIterator>::IntoIter

Which kind of iterator are we turning this into?

fn into_iter(self) -> Self::IntoIter[src]

Creates an iterator from a value. Read more

impl<'a> IntoIterator for &'a Scope[src]

type Item = &'a ScopeTokenRef

The type of the elements being iterated over.

type IntoIter = Iter<'a>

Which kind of iterator are we turning this into?

fn into_iter(self) -> Self::IntoIter[src]

Creates an iterator from a value. Read more

impl PartialEq<Scope> for Scope[src]

fn eq(&self, other: &Scope) -> bool[src]

This method tests for self and other values to be equal, and is used by ==. Read more

fn ne(&self, other: &Scope) -> bool[src]

This method tests for !=.

impl Serialize for Scope[src]

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error> where
    __S: Serializer
[src]

Serialize this value into the given Serde serializer. Read more

impl TryFrom<&'_ str> for Scope[src]

type Error = InvalidScopeToken

The type returned in the event of a conversion error.

fn try_from(s: &str) -> Result<Self, Self::Error>[src]

Performs the conversion.

impl TryFrom<Option<ScopeDto>> for Scope[src]

type Error = InvalidScopeToken

The type returned in the event of a conversion error.

fn try_from(dto: Option<ScopeDto>) -> Result<Self, Self::Error>[src]

Performs the conversion.

impl TryFrom<String> for Scope[src]

type Error = InvalidScopeToken

The type returned in the event of a conversion error.

fn try_from(s: String) -> Result<Self, Self::Error>[src]

Performs the conversion.

impl Eq for Scope[src]

impl StructuralEq for Scope[src]

impl StructuralPartialEq for Scope[src]

Auto Trait Implementations

impl RefUnwindSafe for Scope

impl Send for Scope

impl Sync for Scope

impl Unpin for Scope

impl UnwindSafe for Scope

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

impl<T> From<T> for T[src]

pub fn from(t: T) -> T[src]

Performs the conversion.

impl<T> Instrument for T[src]

fn instrument(self, span: Span) -> Instrumented<Self>[src]

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

fn in_current_span(self) -> Instrumented<Self>[src]

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

pub fn into(self) -> U[src]

Performs the conversion.

impl<D> OwoColorize for D

fn fg<C>(&'a self) -> FgColorDisplay<'a, C, Self> where
    C: Color, 

Set the foreground color generically Read more

fn bg<C>(&'a self) -> BgColorDisplay<'a, C, Self> where
    C: Color, 

Set the background color generically. Read more

fn black(&'a self) -> FgColorDisplay<'a, Black, Self>

Change the foreground color to black

fn on_black(&'a self) -> BgColorDisplay<'a, Black, Self>

Change the foreground color to black

fn red(&'a self) -> FgColorDisplay<'a, Red, Self>

Change the foreground color to red

fn on_red(&'a self) -> BgColorDisplay<'a, Red, Self>

Change the foreground color to red

fn green(&'a self) -> FgColorDisplay<'a, Green, Self>

Change the foreground color to green

fn on_green(&'a self) -> BgColorDisplay<'a, Green, Self>

Change the foreground color to green

fn yellow(&'a self) -> FgColorDisplay<'a, Yellow, Self>

Change the foreground color to yellow

fn on_yellow(&'a self) -> BgColorDisplay<'a, Yellow, Self>

Change the foreground color to yellow

fn blue(&'a self) -> FgColorDisplay<'a, Blue, Self>

Change the foreground color to blue

fn on_blue(&'a self) -> BgColorDisplay<'a, Blue, Self>

Change the foreground color to blue

fn magenta(&'a self) -> FgColorDisplay<'a, Magenta, Self>

Change the foreground color to magenta

fn on_magenta(&'a self) -> BgColorDisplay<'a, Magenta, Self>

Change the foreground color to magenta

fn purple(&'a self) -> FgColorDisplay<'a, Magenta, Self>

Change the foreground color to purple

fn on_purple(&'a self) -> BgColorDisplay<'a, Magenta, Self>

Change the foreground color to purple

fn cyan(&'a self) -> FgColorDisplay<'a, Cyan, Self>

Change the foreground color to cyan

fn on_cyan(&'a self) -> BgColorDisplay<'a, Cyan, Self>

Change the foreground color to cyan

fn white(&'a self) -> FgColorDisplay<'a, White, Self>

Change the foreground color to white

fn on_white(&'a self) -> BgColorDisplay<'a, White, Self>

Change the foreground color to white

fn bright_black(&'a self) -> FgColorDisplay<'a, BrightBlack, Self>

Change the foreground color to bright black

fn on_bright_black(&'a self) -> BgColorDisplay<'a, BrightBlack, Self>

Change the foreground color to bright black

fn bright_red(&'a self) -> FgColorDisplay<'a, BrightRed, Self>

Change the foreground color to bright red

fn on_bright_red(&'a self) -> BgColorDisplay<'a, BrightRed, Self>

Change the foreground color to bright red

fn bright_green(&'a self) -> FgColorDisplay<'a, BrightGreen, Self>

Change the foreground color to bright green

fn on_bright_green(&'a self) -> BgColorDisplay<'a, BrightGreen, Self>

Change the foreground color to bright green

fn bright_yellow(&'a self) -> FgColorDisplay<'a, BrightYellow, Self>

Change the foreground color to bright yellow

fn on_bright_yellow(&'a self) -> BgColorDisplay<'a, BrightYellow, Self>

Change the foreground color to bright yellow

fn bright_blue(&'a self) -> FgColorDisplay<'a, BrightBlue, Self>

Change the foreground color to bright blue

fn on_bright_blue(&'a self) -> BgColorDisplay<'a, BrightBlue, Self>

Change the foreground color to bright blue

fn bright_magenta(&'a self) -> FgColorDisplay<'a, BrightMagenta, Self>

Change the foreground color to bright magenta

fn on_bright_magenta(&'a self) -> BgColorDisplay<'a, BrightMagenta, Self>

Change the foreground color to bright magenta

fn bright_purple(&'a self) -> FgColorDisplay<'a, BrightMagenta, Self>

Change the foreground color to bright purple

fn on_bright_purple(&'a self) -> BgColorDisplay<'a, BrightMagenta, Self>

Change the foreground color to bright purple

fn bright_cyan(&'a self) -> FgColorDisplay<'a, BrightCyan, Self>

Change the foreground color to bright cyan

fn on_bright_cyan(&'a self) -> BgColorDisplay<'a, BrightCyan, Self>

Change the foreground color to bright cyan

fn bright_white(&'a self) -> FgColorDisplay<'a, BrightWhite, Self>

Change the foreground color to bright white

fn on_bright_white(&'a self) -> BgColorDisplay<'a, BrightWhite, Self>

Change the foreground color to bright white

fn bold(&'a self) -> BoldDisplay<'a, Self>

Make the text bold

fn dimmed(&'a self) -> DimDisplay<'a, Self>

Make the text dim

fn italic(&'a self) -> ItalicDisplay<'a, Self>

Make the text italicized

fn underline(&'a self) -> UnderlineDisplay<'a, Self>

Make the text italicized

Make the text blink

Make the text blink (but fast!)

fn reversed(&'a self) -> ReversedDisplay<'a, Self>

Swap the foreground and background colors

fn hidden(&'a self) -> HiddenDisplay<'a, Self>

Hide the text

fn strikethrough(&'a self) -> StrikeThroughDisplay<'a, Self>

Cross out the text

fn color<Color>(&'a self, color: Color) -> FgDynColorDisplay<'a, Color, Self> where
    Color: DynColor, 

Set the foreground color at runtime. Only use if you do not know which color will be used at compile-time. If the color is constant, use either OwoColorize::fg or a color-specific method, such as OwoColorize::green, Read more

fn on_color<Color>(&'a self, color: Color) -> BgDynColorDisplay<'a, Color, Self> where
    Color: DynColor, 

Set the background color at runtime. Only use if you do not know what color to use at compile-time. If the color is constant, use either OwoColorize::bg or a color-specific method, such as OwoColorize::on_yellow, Read more

fn truecolor(&'a self, r: u8, g: u8, b: u8) -> FgDynColorDisplay<'a, Rgb, Self>

Sets the foreground color to an RGB value.

fn on_truecolor(
    &'a self,
    r: u8,
    g: u8,
    b: u8
) -> BgDynColorDisplay<'a, Rgb, Self>

Sets the background color to an RGB value.

fn style(&self, style: Style) -> Styled<&Self>

Apply a runtime-determined style

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

pub fn to_owned(&self) -> T[src]

Creates owned data from borrowed data, usually by cloning. Read more

pub fn clone_into(&self, target: &mut T)[src]

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]

Performs the conversion.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]

Performs the conversion.

impl<T> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]