pub struct Config {
pub include: Vec<String>,
pub exclude: Vec<String>,
pub max_file_size: u64,
pub respect_gitignore: bool,
pub index_hidden: bool,
pub index_binary: bool,
pub index_empty: bool,
pub backend: Backend,
pub merge_threshold: usize,
}Expand description
Persistent project configuration.
Fields§
§include: Vec<String>Glob patterns to include (empty = all text files).
exclude: Vec<String>Extra glob patterns to exclude (on top of .gitignore).
max_file_size: u64Skip files larger than this many bytes. 0 disables the cap entirely
(grep parity: grep has no size limit).
respect_gitignore: boolHonor .gitignore / .ignore files during the walk.
Index hidden files and directories.
index_binary: boolIndex files containing NUL bytes (binary). Off by default; grep scans
such files (grep -a), so enabling this restores grep parity.
index_empty: boolIndex empty (zero-byte) files. Off by default since they never match.
backend: BackendIngest read backend.
merge_threshold: usizeMerge segments automatically once this many accumulate.
Implementations§
Source§impl Config
impl Config
pub fn load(path: &Path) -> Result<Config>
Sourcepub fn apply_env_overrides(&mut self)
pub fn apply_env_overrides(&mut self)
Overlay GREPLM_* environment variables on top of the loaded config.
Env wins over the file so a one-off GREPLM_INDEX_BINARY=1 greplm index
works without editing config.toml. Unset or unparseable vars are
ignored (the file/default value stands).
pub fn save(&self, path: &Path) -> Result<()>
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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