pub struct CodebookConfigFile {
pub cache_dir: PathBuf,
/* private fields */
}Fields§
§cache_dir: PathBufDirectory for caching
Implementations§
Source§impl CodebookConfigFile
impl CodebookConfigFile
Sourcepub fn load(current_dir: Option<&Path>) -> Result<Self, Error>
pub fn load(current_dir: Option<&Path>) -> Result<Self, Error>
Load configuration by searching for both global and project-specific configs
Sourcepub fn reload(&self) -> Result<bool, Error>
pub fn reload(&self) -> Result<bool, Error>
Reload both global and project configurations, only reading files if they’ve changed
Sourcepub fn save_global(&self) -> Result<(), Error>
pub fn save_global(&self) -> Result<(), Error>
Save the global configuration to its file
Sourcepub fn clean_cache(&self)
pub fn clean_cache(&self)
Clean the cache directory
Sourcepub fn project_config_path(&self) -> Option<PathBuf>
pub fn project_config_path(&self) -> Option<PathBuf>
Get path to project config if it exists
Sourcepub fn global_config_path(&self) -> Option<PathBuf>
pub fn global_config_path(&self) -> Option<PathBuf>
Get path to global config if it exists
Trait Implementations§
Source§impl CodebookConfig for CodebookConfigFile
impl CodebookConfig for CodebookConfigFile
Source§fn add_word(&self, word: &str) -> Result<bool, Error>
fn add_word(&self, word: &str) -> Result<bool, Error>
Add a word to the project configs allowlist
Source§fn add_word_global(&self, word: &str) -> Result<bool, Error>
fn add_word_global(&self, word: &str) -> Result<bool, Error>
Add a word to the global configs allowlist
Source§fn get_dictionary_ids(&self) -> Vec<String>
fn get_dictionary_ids(&self) -> Vec<String>
Get dictionary IDs from effective configuration
Source§fn should_ignore_path(&self, path: &Path) -> bool
fn should_ignore_path(&self, path: &Path) -> bool
Check if a path should be ignored based on the effective configuration
Source§fn is_allowed_word(&self, word: &str) -> bool
fn is_allowed_word(&self, word: &str) -> bool
Check if a word is in the effective allowlist
Source§fn should_flag_word(&self, word: &str) -> bool
fn should_flag_word(&self, word: &str) -> bool
Check if a word should be flagged according to effective configuration
Source§fn get_ignore_patterns(&self) -> Option<Vec<Regex>>
fn get_ignore_patterns(&self) -> Option<Vec<Regex>>
Get the list of user-defined ignore patterns
Source§fn get_min_word_length(&self) -> usize
fn get_min_word_length(&self) -> usize
Get the minimum word length which should be checked
fn cache_dir(&self) -> &Path
Source§impl Debug for CodebookConfigFile
impl Debug for CodebookConfigFile
Auto Trait Implementations§
impl !Freeze for CodebookConfigFile
impl RefUnwindSafe for CodebookConfigFile
impl Send for CodebookConfigFile
impl Sync for CodebookConfigFile
impl Unpin for CodebookConfigFile
impl UnwindSafe for CodebookConfigFile
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