[−][src]Struct digest_auth::AuthContext
Login attempt context
All fields are borrowed to reduce runtime overhead; this struct should not be stored anywhere, it is normally meaningful only for the one request.
Fields
username: Cow<'a, str>
Login username
password: Cow<'a, str>
Login password (plain)
uri: Cow<'a, str>
Requested URI (not a domain! should start with a slash)
body: Option<Cow<'a, [u8]>>
Request payload body - used for auth-int (auth with integrity check) May be left out if not using auth-int
method: HttpMethod
HTTP method used (defaults to GET)
cnonce: Option<Cow<'a, str>>
Spoofed client nonce (use only for tests; a random nonce is generated automatically)
Methods
impl<'a> AuthContext<'a>
[src]
pub fn new<UN, PW, UR>(username: UN, password: PW, uri: UR) -> Self where
UN: Into<Cow<'a, str>>,
PW: Into<Cow<'a, str>>,
UR: Into<Cow<'a, str>>,
[src]
UN: Into<Cow<'a, str>>,
PW: Into<Cow<'a, str>>,
UR: Into<Cow<'a, str>>,
Construct a new context with the GET verb and no payload body. See the other constructors if this does not fit your situation.
pub fn new_post<UN, PW, UR, BD>(
username: UN,
password: PW,
uri: UR,
body: Option<BD>
) -> Self where
UN: Into<Cow<'a, str>>,
PW: Into<Cow<'a, str>>,
UR: Into<Cow<'a, str>>,
BD: Into<Cow<'a, [u8]>>,
[src]
username: UN,
password: PW,
uri: UR,
body: Option<BD>
) -> Self where
UN: Into<Cow<'a, str>>,
PW: Into<Cow<'a, str>>,
UR: Into<Cow<'a, str>>,
BD: Into<Cow<'a, [u8]>>,
Construct a new context with the POST verb and a payload body (may be None). See the other constructors if this does not fit your situation.
pub fn new_with_method<UN, PW, UR, BD>(
username: UN,
password: PW,
uri: UR,
body: Option<BD>,
method: HttpMethod
) -> Self where
UN: Into<Cow<'a, str>>,
PW: Into<Cow<'a, str>>,
UR: Into<Cow<'a, str>>,
BD: Into<Cow<'a, [u8]>>,
[src]
username: UN,
password: PW,
uri: UR,
body: Option<BD>,
method: HttpMethod
) -> Self where
UN: Into<Cow<'a, str>>,
PW: Into<Cow<'a, str>>,
UR: Into<Cow<'a, str>>,
BD: Into<Cow<'a, [u8]>>,
Construct a new context with arbitrary verb and, optionally, a payload body
pub fn set_custom_cnonce<CN>(&mut self, cnonce: CN) where
CN: Into<Cow<'a, str>>,
[src]
CN: Into<Cow<'a, str>>,
Set cnonce to the given value
Trait Implementations
Auto Trait Implementations
impl<'a> Send for AuthContext<'a>
impl<'a> Sync for AuthContext<'a>
impl<'a> Unpin for AuthContext<'a>
impl<'a> UnwindSafe for AuthContext<'a>
impl<'a> RefUnwindSafe for AuthContext<'a>
Blanket Implementations
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,