Struct http_auth_basic::Credentials [−][src]
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]
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 PartialEq<Credentials> 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]
impl StructuralPartialEq for Credentials
[src]Auto Trait Implementations
impl RefUnwindSafe for Credentials
impl RefUnwindSafe for Credentials
impl Send for Credentials
impl Send for Credentials
impl Sync for Credentials
impl Sync for Credentials
impl Unpin for Credentials
impl Unpin for Credentials
impl UnwindSafe for Credentials
impl UnwindSafe for Credentials