pub struct OpenRouterProvider;Expand description
OpenRouter provider.
Implementations§
Trait Implementations§
Source§impl Default for OpenRouterProvider
impl Default for OpenRouterProvider
Source§impl OAuthProvider for OpenRouterProvider
impl OAuthProvider for OpenRouterProvider
Source§fn auth_methods(&self) -> Vec<AuthMethod>
fn auth_methods(&self) -> Vec<AuthMethod>
List available authentication methods
Source§fn oauth_config(&self, _method_id: &str) -> Option<OAuthConfig>
fn oauth_config(&self, _method_id: &str) -> Option<OAuthConfig>
Get OAuth configuration for a specific method
Post-authorization processing (e.g., exchange OAuth tokens for API key) Read more
Source§fn apply_auth_headers(
&self,
auth: &ProviderAuth,
headers: &mut HeaderMap,
) -> OAuthResult<()>
fn apply_auth_headers( &self, auth: &ProviderAuth, headers: &mut HeaderMap, ) -> OAuthResult<()>
Apply authentication to HTTP request headers Read more
Source§fn api_key_env_var(&self) -> Option<&'static str>
fn api_key_env_var(&self) -> Option<&'static str>
Get the environment variable name for API key (if supported)
Source§fn device_flow(&self, method_id: &str) -> OAuthResult<DeviceFlow>
fn device_flow(&self, method_id: &str) -> OAuthResult<DeviceFlow>
Build a
DeviceFlow for the given method. Read moreSource§fn request_device_code<'life0, 'life1, 'async_trait>(
&'life0 self,
method_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = OAuthResult<(DeviceFlow, DeviceCodeResponse)>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn request_device_code<'life0, 'life1, 'async_trait>(
&'life0 self,
method_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = OAuthResult<(DeviceFlow, DeviceCodeResponse)>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Step 1 of the Device Authorization Grant: request a device code.
Source§fn wait_for_token<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
flow: &'life1 DeviceFlow,
device_code: &'life2 DeviceCodeResponse,
) -> Pin<Box<dyn Future<Output = OAuthResult<DeviceTokenResponse>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn wait_for_token<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
flow: &'life1 DeviceFlow,
device_code: &'life2 DeviceCodeResponse,
) -> Pin<Box<dyn Future<Output = OAuthResult<DeviceTokenResponse>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Step 2 of the Device Authorization Grant: poll until the user approves.
Post-authorization processing for the Device Authorization Grant.
Auto Trait Implementations§
impl Freeze for OpenRouterProvider
impl RefUnwindSafe for OpenRouterProvider
impl Send for OpenRouterProvider
impl Sync for OpenRouterProvider
impl Unpin for OpenRouterProvider
impl UnsafeUnpin for OpenRouterProvider
impl UnwindSafe for OpenRouterProvider
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