[][src]Struct twilio_async::Credentials

pub struct Credentials { /* fields omitted */ }

Authentication credentials, as described in RFC7235.

Methods

impl Credentials[src]

pub fn from_auth_scheme(scheme: AuthScheme) -> Credentials[src]

Creates credentials from just an auth-scheme.

pub fn from_token68(scheme: AuthScheme, token: Token68) -> Credentials[src]

Creates credentials from an auth-scheme and token68 data.

pub fn bearer(token: Token68) -> Credentials[src]

Creates Bearer authentication credentials as described in RFC6750.

pub fn basic(user_id: &str, password: &str) -> Result<Credentials, Error>[src]

Creates Basic authentication credentials as described in [RFC7617].

pub fn scheme(&self) -> &AuthScheme[src]

Returns the auth-scheme associated with the credentials.

pub fn token68(&self) -> Option<&Token68>[src]

Returns the token68 value associated with the credentials if present.

pub fn as_bearer(&self) -> Option<&Token68>[src]

Returns the bearer token if this contains Bearer credentials.

Trait Implementations

impl Clone for Credentials[src]

impl Debug for Credentials[src]

impl Display for Credentials[src]

impl Eq for Credentials[src]

impl FromStr for Credentials[src]

type Err = Error

The associated error which can be returned from parsing.

impl PartialEq<Credentials> for Credentials[src]

impl StructuralEq for Credentials[src]

impl StructuralPartialEq for Credentials[src]

Auto Trait Implementations

Blanket Implementations

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

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

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

impl<Q, K> Equivalent<K> for Q where
    K: Borrow<Q> + ?Sized,
    Q: Eq + ?Sized
[src]

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

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

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

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

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.

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.