pub struct OpenRouterHttpPolicy;Expand description
OpenRouter HTTP policy (Bearer + attribution headers).
Trait Implementations§
Source§impl Clone for OpenRouterHttpPolicy
impl Clone for OpenRouterHttpPolicy
Source§fn clone(&self) -> OpenRouterHttpPolicy
fn clone(&self) -> OpenRouterHttpPolicy
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for OpenRouterHttpPolicy
Source§impl Debug for OpenRouterHttpPolicy
impl Debug for OpenRouterHttpPolicy
Source§impl Default for OpenRouterHttpPolicy
impl Default for OpenRouterHttpPolicy
Source§fn default() -> OpenRouterHttpPolicy
fn default() -> OpenRouterHttpPolicy
Returns the “default value” for a type. Read more
Source§impl ProviderHttpPolicy for OpenRouterHttpPolicy
impl ProviderHttpPolicy for OpenRouterHttpPolicy
Source§fn provider_id(&self) -> &'static str
fn provider_id(&self) -> &'static str
Stable provider id (
openrouter, openai, elevenlabs, xai).Source§fn official_origins(&self) -> &'static [&'static str]
fn official_origins(&self) -> &'static [&'static str]
Official HTTPS origins (scheme + host, no path), e.g.
https://openrouter.ai.Source§fn default_base_url(&self) -> &'static str
fn default_base_url(&self) -> &'static str
Default base URL used when the caller omits an explicit endpoint.
Source§fn auth_scheme(&self) -> AuthScheme
fn auth_scheme(&self) -> AuthScheme
Credential attachment scheme for this provider.
Source§fn apply_extra_headers(&self, req: RequestBuilder) -> RequestBuilder
fn apply_extra_headers(&self, req: RequestBuilder) -> RequestBuilder
Provider-specific headers (never cross-applied to other providers).
Source§fn allows_path(&self, path: &str) -> bool
fn allows_path(&self, path: &str) -> bool
Whether
path (relative to the validated base URL) is permitted. Read moreSource§fn custom_endpoint_hint(&self) -> String
fn custom_endpoint_hint(&self) -> String
Operator-facing hint when a credentialed origin is rejected.
Source§fn apply_auth(&self, req: RequestBuilder, api_key: &str) -> RequestBuilder
fn apply_auth(&self, req: RequestBuilder, api_key: &str) -> RequestBuilder
Attach the API key using this policy’s auth scheme.
Source§fn is_official_origin(&self, scheme: &str, host: &str) -> bool
fn is_official_origin(&self, scheme: &str, host: &str) -> bool
True when
scheme/host match an official origin for this policy.Source§fn allows_custom_credentialed_endpoint(&self) -> bool
fn allows_custom_credentialed_endpoint(&self) -> bool
Whether an explicit custom HTTPS endpoint may receive credentials when
crate::remote::RemotePolicy::allow_custom_credentialed_endpoint is set.Auto Trait Implementations§
impl Freeze for OpenRouterHttpPolicy
impl RefUnwindSafe for OpenRouterHttpPolicy
impl Send for OpenRouterHttpPolicy
impl Sync for OpenRouterHttpPolicy
impl Unpin for OpenRouterHttpPolicy
impl UnsafeUnpin for OpenRouterHttpPolicy
impl UnwindSafe for OpenRouterHttpPolicy
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