pub trait Template {
// Required methods
fn template_type(&self) -> TemplateType;
fn env_var_name(&self) -> &'static str;
fn create_settings(
&self,
api_key: &str,
scope: &SnapshotScope,
) -> ClaudeSettings;
fn display_name(&self) -> &'static str;
fn description(&self) -> &'static str;
// Provided methods
fn api_key_url(&self) -> Option<&'static str> { ... }
fn requires_additional_config(&self) -> bool { ... }
fn get_additional_config(&self) -> Result<HashMap<String, String>> { ... }
fn has_variants(&self) -> bool { ... }
fn get_variants() -> Result<Vec<Self>>
where Self: Sized { ... }
fn create_interactively() -> Result<Self>
where Self: Sized { ... }
}Expand description
Trait that all AI provider templates must implement
Required Methods§
Sourcefn template_type(&self) -> TemplateType
fn template_type(&self) -> TemplateType
Get the template type identifier
Sourcefn env_var_name(&self) -> &'static str
fn env_var_name(&self) -> &'static str
Get the environment variable name for the API key
Sourcefn create_settings(
&self,
api_key: &str,
scope: &SnapshotScope,
) -> ClaudeSettings
fn create_settings( &self, api_key: &str, scope: &SnapshotScope, ) -> ClaudeSettings
Create Claude settings for this template
Sourcefn display_name(&self) -> &'static str
fn display_name(&self) -> &'static str
Get display name for the template
Sourcefn description(&self) -> &'static str
fn description(&self) -> &'static str
Get description for the template
Provided Methods§
Sourcefn api_key_url(&self) -> Option<&'static str>
fn api_key_url(&self) -> Option<&'static str>
Get API key acquisition URL (if available)
Sourcefn requires_additional_config(&self) -> bool
fn requires_additional_config(&self) -> bool
Check if this template requires additional configuration (like endpoint ID)
Sourcefn get_additional_config(&self) -> Result<HashMap<String, String>>
fn get_additional_config(&self) -> Result<HashMap<String, String>>
Get additional configuration if needed
Sourcefn has_variants(&self) -> bool
fn has_variants(&self) -> bool
Check if this template has sub-variants (like Pro/Air versions)
Sourcefn get_variants() -> Result<Vec<Self>>where
Self: Sized,
fn get_variants() -> Result<Vec<Self>>where
Self: Sized,
Get available variants if this template supports them
Sourcefn create_interactively() -> Result<Self>where
Self: Sized,
fn create_interactively() -> Result<Self>where
Self: Sized,
Create a template instance interactively (for templates with variants)