pub struct PasswordParams<'a> {
pub username: &'a str,
pub password: &'a str,
pub uri: &'a str,
pub method: &'a str,
pub body: Option<&'a [u8]>,
}
Expand description
Parameters for responding to a password challenge.
This is cheap to construct; callers generally use a fresh PasswordParams
for each request.
The caller is responsible for supplying parameters in the correct
format. Servers may expect character data to be in Unicode Normalization
Form C as noted in RFC 7617 section
2.1 for the
Basic
scheme and RFC 7616 section
4 for the Digest
scheme.
Note that most of these fields are only needed for [DigestClient
]. Callers
that only care about the Basic
challenge scheme can use
[BasicClient::respond
] directly with only username and password.
Fields§
§username: &'a str
§password: &'a str
§uri: &'a str
The URI from the Request-URI of the Request-Line, as described in RFC 2617 section 3.2.2.
RFC 2617 section 3.2.2.5, which says the following:
This may be
*
, anabsoluteURL
or anabs_path
as specified in section 5.1.2 of RFC 2616, but it MUST agree with the Request-URI. In particular, it MUST be anabsoluteURL
if the Request-URI is anabsoluteURL
.
RFC 7616 section 3.4 describes this as the “Effective Request URI”, which is always an absolute form. This may be a mistake. Section 3.4.6 matches RFC 2617 section 3.2.2.5, and Appendix A doesn’t mention a change from RFC 2617.
method: &'a str
The HTTP method, such as GET
.
When using the http
crate, use the return value of
[http::Method::as_str
].
body: Option<&'a [u8]>
The entity body, if available. Use Some(&[])
for HTTP methods with no
body.
When None
, Digest
challenges will only be able to use
[crate::digest::Qop::Auth
], not
[crate::digest::Qop::AuthInt
].
Trait Implementations§
source§impl<'a> Clone for PasswordParams<'a>
impl<'a> Clone for PasswordParams<'a>
source§fn clone(&self) -> PasswordParams<'a>
fn clone(&self) -> PasswordParams<'a>
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl<'a> Debug for PasswordParams<'a>
impl<'a> Debug for PasswordParams<'a>
source§impl<'a> PartialEq for PasswordParams<'a>
impl<'a> PartialEq for PasswordParams<'a>
impl<'a> Copy for PasswordParams<'a>
impl<'a> Eq for PasswordParams<'a>
impl<'a> StructuralPartialEq for PasswordParams<'a>
Auto Trait Implementations§
impl<'a> Freeze for PasswordParams<'a>
impl<'a> RefUnwindSafe for PasswordParams<'a>
impl<'a> Send for PasswordParams<'a>
impl<'a> Sync for PasswordParams<'a>
impl<'a> Unpin for PasswordParams<'a>
impl<'a> UnwindSafe for PasswordParams<'a>
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)