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 *, an absoluteURL or an abs_path as specified in section 5.1.2 of RFC 2616, but it MUST agree with the Request-URI. In particular, it MUST be an absoluteURL if the Request-URI is an absoluteURL.

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§

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more
This method tests for self and other values to be equal, and is used by ==.
This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Should always be Self
The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.