Struct digest_auth::AuthContext [−][src]
pub struct AuthContext<'a> { pub username: Cow<'a, str>, pub password: Cow<'a, str>, pub uri: Cow<'a, str>, pub body: Option<Cow<'a, [u8]>>, pub method: HttpMethod<'a>, pub cnonce: Option<Cow<'a, str>>, }
Expand description
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<'a>
HTTP method used (defaults to GET)
cnonce: Option<Cow<'a, str>>
Spoofed client nonce (use only for tests; a random nonce is generated automatically)
Implementations
impl<'a> AuthContext<'a>
[src]
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]
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]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]
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]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<'a>
) -> Self where
UN: Into<Cow<'a, str>>,
PW: Into<Cow<'a, str>>,
UR: Into<Cow<'a, str>>,
BD: Into<Cow<'a, [u8]>>,
[src]
pub fn new_with_method<UN, PW, UR, BD>(
username: UN,
password: PW,
uri: UR,
body: Option<BD>,
method: HttpMethod<'a>
) -> Self where
UN: Into<Cow<'a, str>>,
PW: Into<Cow<'a, str>>,
UR: Into<Cow<'a, str>>,
BD: Into<Cow<'a, [u8]>>,
[src]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]
pub fn set_custom_cnonce<CN>(&mut self, cnonce: CN) where
CN: Into<Cow<'a, str>>,
[src]Set cnonce to the given value
Trait Implementations
Auto Trait Implementations
impl<'a> RefUnwindSafe for AuthContext<'a>
impl<'a> Send for AuthContext<'a>
impl<'a> Sync for AuthContext<'a>
impl<'a> Unpin for AuthContext<'a>
impl<'a> UnwindSafe for AuthContext<'a>
Blanket Implementations
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]pub fn borrow_mut(&mut self) -> &mut T
[src]
pub fn borrow_mut(&mut self) -> &mut T
[src]Mutably borrows from an owned value. Read more
impl<T> Same<T> for T
impl<T> Same<T> for T
type Output = T
type Output = T
Should always be Self
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,