pub struct HttpAuthBasic {
pub username: String,
pub password: SecretString,
}Expand description
HTTP Basic credential pair; password is redacted in
fmt::Debug and zeroed on drop.
Fields§
§username: StringThe username, in clear.
password: SecretStringThe password, redacted in fmt::Debug and zeroed on drop.
Implementations§
Source§impl HttpAuthBasic
impl HttpAuthBasic
Sourcepub fn new(username: impl Into<String>, password: impl Into<String>) -> Self
pub fn new(username: impl Into<String>, password: impl Into<String>) -> Self
Wraps a username + password.
Returns the Basic <base64(user:pass)> header value.
Parses a Basic <b64> header value.
The payload decodes leniently, as base64-codec does: missing padding, non-zero trailing bits and blanks are accepted, any other byte outside the alphabet refused.
Trait Implementations§
Source§impl Clone for HttpAuthBasic
impl Clone for HttpAuthBasic
Source§impl Debug for HttpAuthBasic
impl Debug for HttpAuthBasic
impl Eq for HttpAuthBasic
Auto Trait Implementations§
impl Freeze for HttpAuthBasic
impl RefUnwindSafe for HttpAuthBasic
impl Send for HttpAuthBasic
impl Sync for HttpAuthBasic
impl Unpin for HttpAuthBasic
impl UnsafeUnpin for HttpAuthBasic
impl UnwindSafe for HttpAuthBasic
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more