http_auth

Enum PasswordClient

source
#[non_exhaustive]
pub enum PasswordClient {}
Expand description

Client for responding to a password challenge.

Typically created via TryFrom implementations for a parsed challenge (crate::ChallengeRef) or unparsed challenges (str, [http::header::HeaderValue], or [http::header::GetAll]). See full example in the crate-level documentation.

For more complex scenarios, see PasswordClientBuilder.

Implementations§

source§

impl PasswordClient

source

pub fn builder() -> PasswordClientBuilder

Builds a new PasswordClient.

See example at PasswordClientBuilder.

source

pub fn respond(&mut self, p: &PasswordParams<'_>) -> Result<String, String>

Responds to the challenge with the supplied parameters.

The caller should use the returned string as an Authorization or Proxy-Authorization header value.

Trait Implementations§

source§

impl Debug for PasswordClient

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl PartialEq for PasswordClient

source§

fn eq(&self, other: &PasswordClient) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl TryFrom<&ChallengeRef<'_>> for PasswordClient

Tries to create a PasswordClient from the single supplied challenge.

This is a convenience wrapper around PasswordClientBuilder.

source§

type Error = String

The type returned in the event of a conversion error.
source§

fn try_from(value: &ChallengeRef<'_>) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl TryFrom<&str> for PasswordClient

Tries to create a PasswordClient from the supplied str challenge list.

This is a convenience wrapper around PasswordClientBuilder.

source§

type Error = String

The type returned in the event of a conversion error.
source§

fn try_from(value: &str) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl Eq for PasswordClient

source§

impl StructuralPartialEq for PasswordClient

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

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

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

source§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.