pub trait AuthProvider:
Send
+ Sync
+ 'static {
// Required methods
fn ws_url(&self, model: &GeminiModel) -> String;
fn auth_headers<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<(String, String)>, AuthError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
// Provided methods
fn rest_url(
&self,
endpoint: ServiceEndpoint,
model: Option<&GeminiModel>,
) -> String { ... }
fn query_params(&self) -> Vec<(String, String)> { ... }
fn refresh<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(), AuthError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait { ... }
}Expand description
Provides authentication credentials and URL construction for Gemini API connections.
Required Methods§
Sourcefn ws_url(&self, model: &GeminiModel) -> String
fn ws_url(&self, model: &GeminiModel) -> String
Build the WebSocket URL for the given model.
Provided Methods§
Sourcefn rest_url(
&self,
endpoint: ServiceEndpoint,
model: Option<&GeminiModel>,
) -> String
fn rest_url( &self, endpoint: ServiceEndpoint, model: Option<&GeminiModel>, ) -> String
Build a REST API URL for the given service endpoint and model.
Default implementation panics — override when using HTTP client features.
Sourcefn query_params(&self) -> Vec<(String, String)>
fn query_params(&self) -> Vec<(String, String)>
Query parameters to append to the URL (e.g., API key).