pub struct Catalogue { /* private fields */ }Expand description
Combined view of the built-in catalogue plus any user patterns
loaded from ~/.devboy/secrets/patterns.d/*.toml.
Implementations§
Source§impl Catalogue
impl Catalogue
Sourcepub fn builtins_only() -> Self
pub fn builtins_only() -> Self
Catalogue with no user patterns — equivalent to the built-in list alone.
Sourcepub fn load(dir: &Path) -> Result<Self, LoadError>
pub fn load(dir: &Path) -> Result<Self, LoadError>
Load user patterns from a directory and merge with built-ins.
If dir does not exist, the catalogue contains only built-ins
(no error, no warning — the directory is opt-in).
Sourcepub fn iter(&self) -> Vec<&dyn SecretPattern>
pub fn iter(&self) -> Vec<&dyn SecretPattern>
Walk every visible pattern (user + non-shadowed built-ins). User patterns come first so iteration order is stable when a user override exists.
Sourcepub fn find(&self, id: &str) -> Option<&dyn SecretPattern>
pub fn find(&self, id: &str) -> Option<&dyn SecretPattern>
Look up a pattern by id, preferring a user override over the built-in.
Sourcepub fn warnings(&self) -> &[LoadWarning]
pub fn warnings(&self) -> &[LoadWarning]
Non-fatal warnings produced during loading (shadowed built-in
ids, skipped non-toml files, …). doctor consumes these.
Sourcepub fn has_user_patterns(&self) -> bool
pub fn has_user_patterns(&self) -> bool
true when the catalogue holds any user-supplied pattern.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Catalogue
impl RefUnwindSafe for Catalogue
impl Send for Catalogue
impl Sync for Catalogue
impl Unpin for Catalogue
impl UnsafeUnpin for Catalogue
impl UnwindSafe for Catalogue
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