pub trait ConfigDefaultsProvider: Send + Sync {
// Required methods
fn workspace_paths_for(
&self,
workspace_root: &Path,
) -> Box<dyn WorkspacePaths>;
fn home_config_paths(&self, config_file_name: &str) -> Vec<PathBuf>;
fn syntax_theme(&self) -> String;
fn syntax_languages(&self) -> Vec<String>;
// Provided methods
fn config_file_name(&self) -> &str { ... }
fn canonical_user_config_dir(&self) -> Result<Option<PathBuf>> { ... }
fn canonical_user_config_path(
&self,
config_file_name: &str,
) -> Result<Option<PathBuf>> { ... }
fn system_config_paths(
&self,
_config_file_name: &str,
) -> Result<Vec<PathBuf>> { ... }
}Expand description
Provides access to filesystem and syntax defaults used by the configuration loader.
Required Methods§
Sourcefn workspace_paths_for(&self, workspace_root: &Path) -> Box<dyn WorkspacePaths>
fn workspace_paths_for(&self, workspace_root: &Path) -> Box<dyn WorkspacePaths>
Creates a WorkspacePaths implementation for the provided workspace
root.
Sourcefn home_config_paths(&self, config_file_name: &str) -> Vec<PathBuf>
fn home_config_paths(&self, config_file_name: &str) -> Vec<PathBuf>
Returns the fallback configuration locations searched outside the workspace.
Sourcefn syntax_theme(&self) -> String
fn syntax_theme(&self) -> String
Returns the default syntax highlighting theme identifier.
Sourcefn syntax_languages(&self) -> Vec<String>
fn syntax_languages(&self) -> Vec<String>
Returns the default list of syntax highlighting languages.
Provided Methods§
Sourcefn config_file_name(&self) -> &str
fn config_file_name(&self) -> &str
Returns the primary configuration file name expected in a workspace.
Sourcefn canonical_user_config_dir(&self) -> Result<Option<PathBuf>>
fn canonical_user_config_dir(&self) -> Result<Option<PathBuf>>
Returns the canonical user configuration directory.
The default preserves custom providers by deriving it from their highest-precedence home configuration path.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".