feat(core): expose apply_search_filters as a public API - #568
Merged
Conversation
Flips apply_search_filters from pub(crate) to pub, plus an explicit pub use re-export (the containing apply module stays private via a pub(crate) glob for everything else in it — row_passes_filters, apply_derived_filters — which are staying internal helpers). This is a visibility change only, exposing a function, not new data: SearchFilters and DisplayRow are already fully public types with their whole field list visible in source today. What's new is the ability to call the existing ~20-axis filter-matching engine from outside uffs-core at all. Motivating use case: a private downstream crate (uffs-index-private, in the uffs-products repo — see PRIVATE_RICH_INDEX_DESIGN.md there) wants to carry more fields per record than the public CompactRecord does (ChangeTime, USN, security_id, owner_id — all already parsed by uffs-mft's StandardInfo today, just unused downstream), without growing the public struct's per-record cost for every UFFS user. It builds its own richer record type, adapts the overlapping fields into a DisplayRow via DisplayRow::new (already a public constructor taking only plain data), and now can run the whole existing filter engine against it unchanged instead of forking or reimplementing it — then applies its own small extra-fields filter pass on top for whatever DisplayRow doesn't carry. Verified: cargo doc confirms the item is genuinely externally reachable at uffs_core::search::filters::apply_search_filters (not just visible in source); fmt/lint-prod/lint-tests/tests all clean.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Flips `apply_search_filters` from `pub(crate)` to `pub` (plus an explicit
`pub use` re-export, since its containing module is otherwise re-exported at
`pub(crate)`). Visibility change only — no new data or logic. `SearchFilters`
and `DisplayRow` are already fully public types with their whole field list
visible in source today; what's new is the ability to call the existing
~20-axis filter-matching engine from outside `uffs-core` at all.
Motivating use case
A private downstream crate (`uffs-index-private`, planned in the
`uffs-products` repo — see `PRIVATE_RICH_INDEX_DESIGN.md` there) wants to
carry more fields per record than the public `CompactRecord` does
(ChangeTime, USN, security_id, owner_id — all already parsed by `uffs-mft`'s
`StandardInfo` today, just unused downstream), without growing the public
struct's per-record cost for every UFFS user.
It builds its own richer record type, adapts the overlapping fields into a
`DisplayRow` via `DisplayRow::new` (already a public constructor taking only
plain data), and can now run the whole existing filter engine against it
unchanged instead of forking or reimplementing it — then applies its own
small extra-fields filter pass on top for whatever `DisplayRow` doesn't
carry.
Test plan
`uffs_core::search::filters::apply_search_filters` (not just visible
in source)