pub struct HttpCredentials {
pub username: String,
pub password: String,
pub origin: Option<String>,
}Expand description
HTTP credentials for authentication.
Fields§
§username: StringUsername for authentication.
password: StringPassword for authentication.
origin: Option<String>Optional origin to restrict credentials to. If None, credentials apply to all origins.
Implementations§
Source§impl HttpCredentials
impl HttpCredentials
Sourcepub fn new(username: impl Into<String>, password: impl Into<String>) -> Self
pub fn new(username: impl Into<String>, password: impl Into<String>) -> Self
Create new HTTP credentials.
Sourcepub fn for_origin(
username: impl Into<String>,
password: impl Into<String>,
origin: impl Into<String>,
) -> Self
pub fn for_origin( username: impl Into<String>, password: impl Into<String>, origin: impl Into<String>, ) -> Self
Create HTTP credentials restricted to a specific origin.
Sourcepub fn matches_origin(&self, challenge_origin: &str) -> bool
pub fn matches_origin(&self, challenge_origin: &str) -> bool
Check if these credentials apply to the given challenge origin.
Trait Implementations§
Source§impl Clone for HttpCredentials
impl Clone for HttpCredentials
Source§fn clone(&self) -> HttpCredentials
fn clone(&self) -> HttpCredentials
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for HttpCredentials
impl RefUnwindSafe for HttpCredentials
impl Send for HttpCredentials
impl Sync for HttpCredentials
impl Unpin for HttpCredentials
impl UnwindSafe for HttpCredentials
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more