pub enum AuthMethod {
Basic(String, Option<String>),
Bearer(String),
Custom(Box<dyn Fn(ProviderRequestBuilder) -> ProviderRequestBuilder + Send + Sync + 'static>),
}
Expand description
Authentication method for a request (Basic, Bearer, or Custom closure).
Variants§
Basic(String, Option<String>)
HTTP Basic authentication.
Takes a username (String
) and an optional password (Option<String>
).
Bearer(String)
HTTP Bearer authentication.
Takes a token (String
).
Custom(Box<dyn Fn(ProviderRequestBuilder) -> ProviderRequestBuilder + Send + Sync + 'static>)
Implementations§
Source§impl AuthMethod
impl AuthMethod
Sourcepub fn header_api_key(header_name: String, api_key: String) -> Self
pub fn header_api_key(header_name: String, api_key: String) -> Self
Trait Implementations§
Auto Trait Implementations§
impl Freeze for AuthMethod
impl !RefUnwindSafe for AuthMethod
impl Send for AuthMethod
impl Sync for AuthMethod
impl Unpin for AuthMethod
impl !UnwindSafe for AuthMethod
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