Struct aliri_oauth2::scope::ScopeToken
source · pub struct ScopeToken(/* private fields */);
Expand description
An OAuth2 (or OIDC) scope token as defined in RFC 6749, Section 3.3
A scope token must be composed of printable ASCII characters excluding
(space), "
(double quote), and \
(backslash).
Implementations§
source§impl ScopeToken
impl ScopeToken
sourcepub fn new(raw: CompactString) -> Result<Self, <ScopeToken as Validator>::Error>
pub fn new(raw: CompactString) -> Result<Self, <ScopeToken as Validator>::Error>
Constructs a new ScopeToken if it conforms to ScopeToken
sourcepub const unsafe fn new_unchecked(raw: CompactString) -> Self
pub const unsafe fn new_unchecked(raw: CompactString) -> Self
Constructs a new ScopeToken without validation
§Safety
Consumers of this function must ensure that values conform to ScopeToken
. Failure to maintain this invariant may lead to undefined behavior.
sourcepub fn from_static(raw: &'static str) -> Self
pub fn from_static(raw: &'static str) -> Self
Constructs a new ScopeToken from a static reference if it conforms to ScopeToken
§Panics
This function will panic if the provided raw string is not valid.
sourcepub fn into_boxed_ref(self) -> Box<ScopeTokenRef>
pub fn into_boxed_ref(self) -> Box<ScopeTokenRef>
Converts this ScopeToken
into a Box<ScopeTokenRef>
This will drop any excess capacity.
sourcepub fn take(self) -> CompactString
pub fn take(self) -> CompactString
Unwraps the underlying [compact_str :: CompactString
] value
source§impl ScopeToken
impl ScopeToken
sourcepub fn from_string(value: String) -> Result<Self, InvalidScopeToken>
pub fn from_string(value: String) -> Result<Self, InvalidScopeToken>
Construct a new ScopeToken
from a string
§Errors
This function will return an error if the provided string is not a valid scope token.
Methods from Deref<Target = ScopeTokenRef>§
Trait Implementations§
source§impl AsRef<ScopeTokenRef> for ScopeToken
impl AsRef<ScopeTokenRef> for ScopeToken
source§fn as_ref(&self) -> &ScopeTokenRef
fn as_ref(&self) -> &ScopeTokenRef
source§impl AsRef<str> for ScopeToken
impl AsRef<str> for ScopeToken
source§impl Borrow<ScopeTokenRef> for ScopeToken
impl Borrow<ScopeTokenRef> for ScopeToken
source§fn borrow(&self) -> &ScopeTokenRef
fn borrow(&self) -> &ScopeTokenRef
source§impl Borrow<str> for ScopeToken
impl Borrow<str> for ScopeToken
source§impl Clone for ScopeToken
impl Clone for ScopeToken
source§fn clone(&self) -> ScopeToken
fn clone(&self) -> ScopeToken
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for ScopeToken
impl Debug for ScopeToken
source§impl Deref for ScopeToken
impl Deref for ScopeToken
source§impl<'de> Deserialize<'de> for ScopeToken
impl<'de> Deserialize<'de> for ScopeToken
source§fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
source§impl Display for ScopeToken
impl Display for ScopeToken
source§impl From<&ScopeTokenRef> for ScopeToken
impl From<&ScopeTokenRef> for ScopeToken
source§fn from(s: &ScopeTokenRef) -> Self
fn from(s: &ScopeTokenRef) -> Self
source§impl From<Box<ScopeTokenRef>> for ScopeToken
impl From<Box<ScopeTokenRef>> for ScopeToken
source§fn from(r: Box<ScopeTokenRef>) -> Self
fn from(r: Box<ScopeTokenRef>) -> Self
source§impl<'a> From<Cow<'a, ScopeTokenRef>> for ScopeToken
impl<'a> From<Cow<'a, ScopeTokenRef>> for ScopeToken
source§fn from(r: Cow<'a, ScopeTokenRef>) -> Self
fn from(r: Cow<'a, ScopeTokenRef>) -> Self
source§impl From<ScopeToken> for Box<ScopeTokenRef>
impl From<ScopeToken> for Box<ScopeTokenRef>
source§fn from(r: ScopeToken) -> Self
fn from(r: ScopeToken) -> Self
source§impl<'a> From<ScopeToken> for Cow<'a, ScopeTokenRef>
impl<'a> From<ScopeToken> for Cow<'a, ScopeTokenRef>
source§fn from(owned: ScopeToken) -> Self
fn from(owned: ScopeToken) -> Self
source§impl From<ScopeToken> for Scope
impl From<ScopeToken> for Scope
source§fn from(t: ScopeToken) -> Self
fn from(t: ScopeToken) -> Self
source§impl From<ScopeToken> for String
impl From<ScopeToken> for String
source§fn from(s: ScopeToken) -> Self
fn from(s: ScopeToken) -> Self
source§impl FromStr for ScopeToken
impl FromStr for ScopeToken
source§impl Hash for ScopeToken
impl Hash for ScopeToken
source§impl Ord for ScopeToken
impl Ord for ScopeToken
source§impl PartialEq<&ScopeTokenRef> for ScopeToken
impl PartialEq<&ScopeTokenRef> for ScopeToken
source§fn eq(&self, other: &&ScopeTokenRef) -> bool
fn eq(&self, other: &&ScopeTokenRef) -> bool
self
and other
values to be equal, and is used
by ==
.source§impl PartialEq<ScopeToken> for &ScopeTokenRef
impl PartialEq<ScopeToken> for &ScopeTokenRef
source§fn eq(&self, other: &ScopeToken) -> bool
fn eq(&self, other: &ScopeToken) -> bool
self
and other
values to be equal, and is used
by ==
.source§impl PartialEq<ScopeToken> for ScopeTokenRef
impl PartialEq<ScopeToken> for ScopeTokenRef
source§fn eq(&self, other: &ScopeToken) -> bool
fn eq(&self, other: &ScopeToken) -> bool
self
and other
values to be equal, and is used
by ==
.source§impl PartialEq<ScopeTokenRef> for ScopeToken
impl PartialEq<ScopeTokenRef> for ScopeToken
source§fn eq(&self, other: &ScopeTokenRef) -> bool
fn eq(&self, other: &ScopeTokenRef) -> bool
self
and other
values to be equal, and is used
by ==
.source§impl PartialEq for ScopeToken
impl PartialEq for ScopeToken
source§fn eq(&self, other: &ScopeToken) -> bool
fn eq(&self, other: &ScopeToken) -> bool
self
and other
values to be equal, and is used
by ==
.source§impl PartialOrd for ScopeToken
impl PartialOrd for ScopeToken
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self
and other
) and is used by the <=
operator. Read moresource§impl Serialize for ScopeToken
impl Serialize for ScopeToken
source§impl TryFrom<&str> for ScopeToken
impl TryFrom<&str> for ScopeToken
source§impl TryFrom<String> for ScopeToken
impl TryFrom<String> for ScopeToken
source§impl Validator for ScopeToken
impl Validator for ScopeToken
impl Eq for ScopeToken
impl StructuralPartialEq for ScopeToken
Auto Trait Implementations§
impl Freeze for ScopeToken
impl RefUnwindSafe for ScopeToken
impl Send for ScopeToken
impl Sync for ScopeToken
impl Unpin for ScopeToken
impl UnwindSafe for ScopeToken
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
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> ToCompactString for Twhere
T: Display,
impl<T> ToCompactString for Twhere
T: Display,
source§fn to_compact_string(&self) -> CompactString
fn to_compact_string(&self) -> CompactString
CompactString
. Read more