pub struct Auth {
pub bearer: Option<String>,
pub basic: Option<BasicAuth>,
pub api_key: Option<ApiKeyAuth>,
pub oauth: Option<OAuthAuth>,
}Expand description
crate::Request::auth: exactly one of bearer, basic, api_key or
oauth, enforced by Auth::validate_exclusivity.
This is also the shape a default auth: at the environment level reuses
unchanged (see crate::environment::Environment::auth) — api_key
and oauth join bearer/basic as mutually-exclusive cases in that same
shape, so kept as its own type rather than inlined onto Request, the
same way MultipartPart is its own type rather than an inline tuple.
Fields§
§bearer: Option<String>Sets Authorization: Bearer <bearer>.
basic: Option<BasicAuth>Sets Authorization: Basic <base64(user:pass)>.
api_key: Option<ApiKeyAuth>Sets a named header or query parameter to a static value — see
ApiKeyAuth.
oauth: Option<OAuthAuth>Acquires a bearer token from an OAuth token endpoint before the
request is sent — see OAuthAuth.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Auth
impl<'de> Deserialize<'de> for Auth
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for Auth
impl StructuralPartialEq for Auth
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.