pub struct Config {
pub sensitive_keywords: Vec<String>,
pub ignore_prefixes: Vec<String>,
pub search_limit: usize,
pub stats: StatsConfig,
pub maintenance: MaintenanceConfig,
}Fields§
§sensitive_keywords: Vec<String>Commandes contenant un de ces mots-clés sont ignorées.
ignore_prefixes: Vec<String>Préfixes de commandes à ne jamais enregistrer (ex: “mnemo”).
search_limit: usizeNombre maximal de commandes chargées dans la TUI.
stats: StatsConfigOptions propres à mnemo stats.
maintenance: MaintenanceConfigOptions de maintenance / nettoyage automatique.
Implementations§
Source§impl Config
impl Config
Sourcepub fn load() -> Result<Self>
pub fn load() -> Result<Self>
Charge la config depuis ~/.config/mnemo/config.toml, ou les valeurs
par défaut si le fichier n’existe pas encore.
Sourcepub fn save(&self, path: &Path) -> Result<()>
pub fn save(&self, path: &Path) -> Result<()>
Écrit la config au format TOML, en créant le dossier parent si besoin.
Sourcepub fn normalize_ignored(name: &str) -> String
pub fn normalize_ignored(name: &str) -> String
Normalise un nom de commande pour la liste d’exclusion des stats : trim + minuscules. Stratégie simple et documentée (comparaison exacte, insensible à la casse).
Sourcepub fn add_ignored_command(&mut self, name: &str) -> bool
pub fn add_ignored_command(&mut self, name: &str) -> bool
Ajoute une commande à stats.ignored_commands si absente.
Retourne true si la liste a changé, false si déjà présente.
Sourcepub fn remove_ignored_command(&mut self, name: &str) -> bool
pub fn remove_ignored_command(&mut self, name: &str) -> bool
Retire une commande de stats.ignored_commands si présente.
Retourne true si la liste a changé, false si absente.
Sourcepub fn validate(&self) -> Vec<ConfigIssue>
pub fn validate(&self) -> Vec<ConfigIssue>
Valide les valeurs connues de la configuration. Ne touche pas au disque ; renvoie la liste des problèmes détectés (vide = configuration saine).
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Config
impl<'de> Deserialize<'de> for Config
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Auto Trait Implementations§
impl Freeze for Config
impl RefUnwindSafe for Config
impl Send for Config
impl Sync for Config
impl Unpin for Config
impl UnsafeUnpin for Config
impl UnwindSafe for Config
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more