pub enum Authorization {
Basic(String),
Bearer(String),
Raw(String),
}
Expand description
Basic, bearer or raw authentication in http or websocket transport.
Use to inject username and password or an auth token into requests.
Variants§
Basic(String)
RFC7617 HTTP Basic Auth.
Bearer(String)
RFC6750 Bearer Auth.
Raw(String)
Raw auth string.
Implementations§
source§impl Authorization
impl Authorization
sourcepub fn extract_from_url(url: &Url) -> Option<Self>
pub fn extract_from_url(url: &Url) -> Option<Self>
Extract the auth info from a URL.
Instantiate a new basic auth from an authority string.
sourcepub fn basic(username: impl AsRef<str>, password: impl AsRef<str>) -> Self
pub fn basic(username: impl AsRef<str>, password: impl AsRef<str>) -> Self
Instantiate a new basic auth from a username and password.
Trait Implementations§
source§impl Clone for Authorization
impl Clone for Authorization
source§fn clone(&self) -> Authorization
fn clone(&self) -> Authorization
Returns a copy 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 moresource§impl Debug for Authorization
impl Debug for Authorization
source§impl Display for Authorization
impl Display for Authorization
source§impl PartialEq for Authorization
impl PartialEq for Authorization
impl Eq for Authorization
impl StructuralPartialEq for Authorization
Auto Trait Implementations§
impl Freeze for Authorization
impl RefUnwindSafe for Authorization
impl Send for Authorization
impl Sync for Authorization
impl Unpin for Authorization
impl UnwindSafe for Authorization
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)