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 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 more
sourceimpl 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 more
sourceimpl Hash for BearerToken
impl Hash for BearerToken
sourceimpl Ord for BearerToken
impl Ord for BearerToken
sourceimpl PartialEq<BearerToken> for BearerToken
impl PartialEq<BearerToken> for BearerToken
sourcefn eq(&self, other: &BearerToken) -> bool
fn eq(&self, other: &BearerToken) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourcefn ne(&self, other: &BearerToken) -> bool
fn ne(&self, other: &BearerToken) -> bool
This method tests for !=
.
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>
This method returns an ordering between self
and other
values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
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 more
sourceimpl 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 T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
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
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more