pub struct BasicAuth { /* private fields */ }Expand description
HTTP Basic Authentication credentials.
Generates Authorization: Basic base64(username:password) headers.
Only available with the basic-auth feature (enabled by the http1/http2
compatibility aliases). Bearer-only lean profiles omit this type and the
core base64 dependency.
§Security
The Debug and Display implementations redact both username and
password. Credentials are never exposed in error messages or logs.
§Policy
- Usernames containing
:are rejected (RFC 7617 ambiguity). - Passwords may be empty.
- Credentials are encoded as UTF-8 bytes.
- CR/LF characters in username or password are rejected.
Implementations§
Source§impl BasicAuth
impl BasicAuth
Trait Implementations§
Auto Trait Implementations§
impl Freeze for BasicAuth
impl RefUnwindSafe for BasicAuth
impl Send for BasicAuth
impl Sync for BasicAuth
impl Unpin for BasicAuth
impl UnsafeUnpin for BasicAuth
impl UnwindSafe for BasicAuth
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