Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 14 additions & 2 deletions crates/uffs-core/src/search/filters/apply.rs
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,20 @@ pub(crate) fn row_passes_filters(
apply_derived_filters(row, filters)
}

/// Apply extended search filters to display rows (in-place).
pub(crate) fn apply_search_filters(rows: &mut Vec<DisplayRow>, filters: &SearchFilters) {
/// Apply extended search filters to display rows (in-place) — retains
/// only the rows that pass every non-empty filter in `filters`.
///
/// Public so a downstream crate holding its own richer row data (more
/// fields than [`DisplayRow`] carries) can still reuse this entire
/// filter engine unchanged: build a [`DisplayRow`] via its public
/// [`DisplayRow::new`] constructor from whatever subset of fields
/// overlaps, run it through this function to get every existing filter
/// axis applied verbatim, then apply any additional filters the extra
/// fields need as a separate, small pass of its own. This avoids
/// forking or reimplementing this engine for that case — see
/// `PRIVATE_RICH_INDEX_DESIGN.md` in the `uffs-products` repo for the
/// concrete motivating use case.
pub fn apply_search_filters(rows: &mut Vec<DisplayRow>, filters: &SearchFilters) {
if filters.is_empty() {
return;
}
Expand Down
5 changes: 5 additions & 0 deletions crates/uffs-core/src/search/filters/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@ mod ext_match;
mod path_normalize;
mod time_parsing;

// `apply_search_filters` is a deliberately public re-export — see its
// own doc comment for why a downstream crate needs to call it directly.
// The `apply::*` glob below stays `pub(crate)`: everything else in
// `apply` (e.g. `row_passes_filters`) is an internal helper.
pub use apply::apply_search_filters;
pub(crate) use apply::*;
pub use attr_parsing::*;
pub(crate) use ext_match::extract_extension_after_dot;
Expand Down
Loading