pub struct Grouping { /* private fields */ }Expand description
Where each of a document’s operations sits in the command tree.
Requires the document feature.
The group is a path segment, and which one is a fact about the whole
document: the first, unless every operation shares it — a document served
entirely under /v1 must not collapse into one group named v1. So the
rule is read off every path once, with Grouping::of, and then applied
to one path at a time.
Grouping is bless-time work. Both names travel in the reduced model, so a shipped binary reads them off its blob and never runs this rule at all.
Implementations§
Source§impl Grouping
impl Grouping
Sourcepub fn of(paths: &[&str]) -> Self
pub fn of(paths: &[&str]) -> Self
Read the rule off every path the document declares.
Descend while every path says the same thing — a segment they all share tells nothing apart — and stop at the first segment that distinguishes them, or before a path parameter, which names a value rather than a resource.