pub struct RequestDefaults {
pub size: SizeMetric,
pub words_per_page: u64,
pub content: AnalysisSet,
pub read_controls: bool,
pub control_limits: ControlLimits,
}Expand description
Every default a request takes when its caller names nothing, stated once.
| Axis | Default |
|---|---|
| Size | allocated |
| Views of a report | Self::report_view: ViewSpec::default_for the content |
| Views of a watch | Self::report_view of no content, which is tree |
| Words per page | 250 |
| Content | no analyzer |
.gitignore | observed, under the default budget and line limit |
Each answers a question: “how much disk does this use” is allocated bytes, as du
reports them; a request that pays to read files displays what it read; and a tree is
what “what is big here” looks like. Surfaces take these rather than declaring their own,
because a default declared twice drifts: size was apparent in Rust and allocated
everywhere else, and words_per_page was written out in three places.
A watch has no view default of its own, and no field here for one. It is derived rather
than declared because it is not a separate decision: RequestError::WatchContent
refuses a watch that names an analyzer, so the content a watch serves is always none and
its view is the report default for none. A field would have restated tree beside the
rule that makes it true, which is the shape a default drifts out of.
Fields§
§size: SizeMetricThe size metric.
words_per_page: u64Logical words per derived document page.
content: AnalysisSetThe analyzers a request enables.
read_controls: boolWhether a scan observes .gitignore.
control_limits: ControlLimitsThe limits .gitignore files are applied under.
Implementations§
Source§impl RequestDefaults
impl RequestDefaults
Sourcepub const fn report_view(self, content: AnalysisSet) -> ViewSpec
pub const fn report_view(self, content: AnalysisSet) -> ViewSpec
The view a report displays when its caller named none: the one that shows what
content read, or the tree when it read nothing.