pub enum ApiKeyLocation {
Header(String),
Query(String),
AuthorizationHeader(String),
}Expand description
Where to look for the API key in requests.
Variants§
Header(String)
Look for the API key in a header (e.g., “X-API-Key”).
Query(String)
Look for the API key in a query parameter (e.g., “?api_key=…”).
AuthorizationHeader(String)
Look for the API key in the Authorization header with a custom scheme.
Example: Authorization: ApiKey sk_live_abc123
Implementations§
Source§impl ApiKeyLocation
impl ApiKeyLocation
Sourcepub fn header(name: impl Into<String>) -> ApiKeyLocation
pub fn header(name: impl Into<String>) -> ApiKeyLocation
Creates a header-based location.
Sourcepub fn query(name: impl Into<String>) -> ApiKeyLocation
pub fn query(name: impl Into<String>) -> ApiKeyLocation
Creates a query parameter-based location.
Creates an Authorization header-based location with a custom scheme.
Trait Implementations§
Source§impl Clone for ApiKeyLocation
impl Clone for ApiKeyLocation
Source§fn clone(&self) -> ApiKeyLocation
fn clone(&self) -> ApiKeyLocation
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 moreSource§impl Debug for ApiKeyLocation
impl Debug for ApiKeyLocation
Source§impl Default for ApiKeyLocation
impl Default for ApiKeyLocation
Source§fn default() -> ApiKeyLocation
fn default() -> ApiKeyLocation
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for ApiKeyLocation
impl RefUnwindSafe for ApiKeyLocation
impl Send for ApiKeyLocation
impl Sync for ApiKeyLocation
impl Unpin for ApiKeyLocation
impl UnwindSafe for ApiKeyLocation
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§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more