Struct aliri_braid_examples::validated::ScopeToken
source · #[repr(transparent)]pub struct ScopeToken(_);
Expand description
A scope token as defined in RFC6749, Section 3.3
This type maintains an invariant that ensures that a value of this type cannot be constructed that contains invalid data.
The borrowed form of this type is generated by appending
Ref to the end of the owned form: ScopeTokenRef
.
Implementations§
source§impl ScopeToken
impl ScopeToken
sourcepub fn new(raw: String) -> Result<Self, <ScopeToken as Validator>::Error>
pub fn new(raw: String) -> Result<Self, <ScopeToken as Validator>::Error>
Constructs a new ScopeToken if it conforms to ScopeToken
sourcepub const unsafe fn new_unchecked(raw: String) -> Self
pub const unsafe fn new_unchecked(raw: String) -> 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.
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
Converts this type into a shared reference of the (usually inferred) input type.
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
Immutably borrows from an owned value. Read more
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
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
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>
Deserialize this value from the given Serde deserializer. Read more
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
Converts to this type from the input type.
source§impl From<Box<ScopeTokenRef, Global>> for ScopeToken
impl From<Box<ScopeTokenRef, Global>> for ScopeToken
source§fn from(r: Box<ScopeTokenRef>) -> Self
fn from(r: Box<ScopeTokenRef>) -> Self
Converts to this type from the input type.
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
Converts to this type from the input type.
source§impl From<ScopeToken> for Box<ScopeTokenRef>
impl From<ScopeToken> for Box<ScopeTokenRef>
source§fn from(r: ScopeToken) -> Self
fn from(r: ScopeToken) -> Self
Converts to this type from the input type.
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
Converts to this type from the input type.
source§impl From<ScopeToken> for String
impl From<ScopeToken> for String
source§fn from(s: ScopeToken) -> Self
fn from(s: ScopeToken) -> Self
Converts to this type from the input type.
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
This method tests for
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
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl PartialEq<ScopeToken> for ScopeToken
impl PartialEq<ScopeToken> for ScopeToken
source§fn eq(&self, other: &ScopeToken) -> bool
fn eq(&self, other: &ScopeToken) -> bool
This method tests for
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
This method tests for
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
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl PartialOrd<ScopeToken> for ScopeToken
impl PartialOrd<ScopeToken> for ScopeToken
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
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 StructuralEq for ScopeToken
impl StructuralPartialEq for ScopeToken
Auto Trait Implementations§
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
Mutably borrows from an owned value. Read more
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
Converts the given value to a
CompactString
. Read more