[−][src]Struct http_auth_basic::Credentials
A struct
to represent the user_id
and password
fields
from an Authorization Basic header value
Fields
user_id: String
password: String
Implementations
impl Credentials
[src]
pub fn new(user_id: &str, password: &str) -> Self
[src]
Create a new Credentials
instance
this is equivalent to writing:
use http_auth_basic::Credentials; let credentials = Credentials { user_id: String::from("Foo"), password: String::from("Bar"), };
pub fn decode(auth_header_value: String) -> Result<Self, AuthBasicError>
[src]
Create a Credentials
instance from a base64 String
which must encode user credentials as username:password
pub fn encode(&self) -> String
[src]
Encode a Credentials
instance into a base64 String
pub fn from_header(auth_header: String) -> Result<Credentials, AuthBasicError>
[src]
Creates a Credentials
instance from an HTTP Authorization header
which schema is a valid Basic
HTTP Authorization Schema.
pub fn as_http_header(&self) -> String
[src]
Creates a HTTP Authorization header value for the basic schema
from the Credentials
instance
Trait Implementations
impl Debug for Credentials
[src]
impl PartialEq<Credentials> for Credentials
[src]
fn eq(&self, other: &Credentials) -> bool
[src]
fn ne(&self, other: &Credentials) -> bool
[src]
impl StructuralPartialEq for Credentials
[src]
Auto Trait Implementations
impl RefUnwindSafe for Credentials
impl Send for Credentials
impl Sync for Credentials
impl Unpin for Credentials
impl UnwindSafe for Credentials
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,