Struct http_auth::ChallengeRef

source ·
pub struct ChallengeRef<'i> {
    pub scheme: &'i str,
    pub params: Vec<(&'i str, ParamValue<'i>)>,
}
Expand description

Parsed challenge (scheme and body) using references to the original header value. Produced by crate::parser::ChallengeParser.

This is not directly useful for responding to a challenge; it’s an intermediary for constructing a client that knows how to respond to a specific challenge scheme. In most cases, callers should construct a PasswordClient without directly using ChallengeRef.

Only supports the param form, not the apocryphal token68 form, as described in crate::parser::ChallengeParser.

Fields§

§scheme: &'i str

The scheme name, which should be compared case-insensitively.

§params: Vec<(&'i str, ParamValue<'i>)>

Zero or more parameters.

These are represented as a Vec of key-value pairs rather than a map. Given that the parameters are generally only used once when constructing a challenge client and each challenge only supports a few parameter types, it’s more efficient in terms of CPU usage and code size to scan through them directly.

Implementations§

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.
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.

Tries to create a PasswordClient from the single supplied challenge.

This is a convenience wrapper around PasswordClientBuilder.

The type returned in the event of a conversion error.
Performs the conversion.

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.