Struct conjure_object::BearerToken
source · [−]pub struct BearerToken(_);
Expand description
An authentication bearer token.
Bearer tokens are strings which match the regular expression ^[A-Za-z0-9\-\._~\+/]+=*$
.
Implementations
sourceimpl BearerToken
impl BearerToken
sourcepub fn new(s: &str) -> Result<BearerToken, ParseError>
pub fn new(s: &str) -> Result<BearerToken, ParseError>
Creates a bearer token from a string, validating that it is in the correct format.
This function behaves identically to BearerToken
’s FromStr
implementation.
sourcepub fn into_string(self) -> String
pub fn into_string(self) -> String
Consumes the bearer token, returning its owned string representation.
Trait Implementations
sourceimpl AsRef<str> for BearerToken
impl AsRef<str> for BearerToken
sourceimpl Borrow<str> for BearerToken
impl Borrow<str> for BearerToken
sourceimpl Clone for BearerToken
impl Clone for BearerToken
sourcefn clone(&self) -> BearerToken
fn clone(&self) -> BearerToken
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresourceimpl Debug for BearerToken
impl Debug for BearerToken
sourceimpl<'de> Deserialize<'de> for BearerToken
impl<'de> Deserialize<'de> for BearerToken
sourcefn deserialize<D>(d: D) -> Result<BearerToken, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(d: D) -> Result<BearerToken, D::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
sourceimpl FromPlain for BearerToken
impl FromPlain for BearerToken
type Err = <BearerToken as FromStr>::Err
type Err = <BearerToken as FromStr>::Err
The error type returned when parsing fails.
sourcefn from_plain(s: &str) -> Result<Self, Self::Err>
fn from_plain(s: &str) -> Result<Self, Self::Err>
Parse a value from its Conjure PLAIN string representation.
sourceimpl FromStr for BearerToken
impl FromStr for BearerToken
type Err = ParseError
type Err = ParseError
The associated error which can be returned from parsing.
sourcefn from_str(s: &str) -> Result<BearerToken, ParseError>
fn from_str(s: &str) -> Result<BearerToken, ParseError>
Parses a string
s
to return a value of this type. Read moresourceimpl Hash for BearerToken
impl Hash for BearerToken
sourceimpl Ord for BearerToken
impl Ord for BearerToken
sourcefn cmp(&self, other: &BearerToken) -> Ordering
fn cmp(&self, other: &BearerToken) -> Ordering
1.21.0 · sourcefn max(self, other: Self) -> Self
fn max(self, other: Self) -> Self
Compares and returns the maximum of two values. Read more
1.21.0 · sourcefn min(self, other: Self) -> Self
fn min(self, other: Self) -> Self
Compares and returns the minimum of two values. Read more
1.50.0 · sourcefn clamp(self, min: Self, max: Self) -> Selfwhere
Self: PartialOrd<Self>,
fn clamp(self, min: Self, max: Self) -> Selfwhere
Self: PartialOrd<Self>,
Restrict a value to a certain interval. Read more
sourceimpl PartialEq<BearerToken> for BearerToken
impl PartialEq<BearerToken> for BearerToken
sourcefn eq(&self, other: &BearerToken) -> bool
fn eq(&self, other: &BearerToken) -> bool
sourceimpl PartialOrd<BearerToken> for BearerToken
impl PartialOrd<BearerToken> for BearerToken
sourcefn partial_cmp(&self, other: &BearerToken) -> Option<Ordering>
fn partial_cmp(&self, other: &BearerToken) -> Option<Ordering>
1.0.0 · sourcefn 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 moresourceimpl Plain for BearerToken
impl Plain for BearerToken
sourceimpl Serialize for BearerToken
impl Serialize for BearerToken
impl Eq for BearerToken
impl StructuralEq for BearerToken
impl StructuralPartialEq for BearerToken
Auto Trait Implementations
impl RefUnwindSafe for BearerToken
impl Send for BearerToken
impl Sync for BearerToken
impl Unpin for BearerToken
impl UnwindSafe for BearerToken
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more