Skip to main content

fdu_core/
query.rs

1//! Queries over a built index: what to select, which roll-ups to report, and the value
2//! grammars both are written in.
3//!
4//! The module is deliberately free of filesystem access and of the `cli` feature. A query
5//! is a pure function of an [`Index`](crate::Index) and a request, so the CLI, the Rust
6//! API, and the Python bindings all compose the same types rather than reimplementing
7//! selection three times — and so a report can never quietly become a producer of state.
8
9mod query_glob;
10mod query_report;
11mod query_request;
12mod query_selection;
13mod query_status;
14mod query_subtrees;
15mod query_values;
16
17pub use query_glob::Pattern;
18pub use query_report::{
19    AxisNames, CodeLanguageRow, CodeOverview, CodeTally, ContentReportMetadata, FileRow,
20    IgnoredSize, IgnoredTally, MetricGroup, MetricRow, MetricShare, MetricSummary, Pages, Query,
21    Report, ReportMetricValues, ReportSource, Section, ShareMetric, SummaryRow, TreeDisplayLimits,
22    TreeNode, TreeOmission, TreeOmissionReason, TreeRemainder, TypeRow, ViewSpec, document_words,
23    pages, report,
24};
25pub(crate) use query_report::{report_in, report_summary};
26pub(crate) use query_request::Rejection;
27pub use query_request::{
28    Basis, Delivery, ReadSpec, Request, RequestDefaults, RequestError, RequestSpec, Scope,
29    ScopeAxis, WatchDelivery, Workers, bound_nanos, parse_bound, parse_cache_policy, parse_kind,
30    parse_kinds, parse_size_metric, parse_sort,
31};
32pub(crate) use query_selection::NameIdentity;
33pub use query_selection::{
34    Bound, Candidate, EntrySelection, IgnoredEntries, ModifiedWindow, Selection, ShareThreshold,
35    SizeMetric, SortKey,
36};
37pub use query_status::{ReportProvenance, TierProvenance, TierState, TreeStatus};
38pub(crate) use query_values::format_rfc3339_nanos;
39pub use query_values::{
40    format_rfc3339, parse_control_budget, parse_control_line_limit, parse_size, parse_when,
41    system_time_to_nanos,
42};