pub enum Auth {
Bearer {
token: TokenSource,
},
Basic {
username: TokenSource,
password: TokenSource,
},
Custom {
prefix: String,
value: TokenSource,
},
}Expand description
Authentication configuration for a client or request.
Variants§
Implementations§
Source§impl Auth
impl Auth
pub fn bearer(token: impl Into<String>) -> Auth
pub fn bearer_fn(f: impl Fn() -> Option<String> + Send + Sync + 'static) -> Auth
pub fn basic(username: impl Into<String>, password: impl Into<String>) -> Auth
pub async fn apply(&self, headers: &mut HeaderMap) -> Result<(), Error>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Auth
impl !RefUnwindSafe for Auth
impl Send for Auth
impl Sync for Auth
impl Unpin for Auth
impl UnsafeUnpin for Auth
impl !UnwindSafe for Auth
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