pub struct ResolvedBoundaryConfig {
pub zones: Vec<ResolvedZone>,
pub rules: Vec<ResolvedBoundaryRule>,
pub logical_groups: Vec<LogicalGroup>,
}Expand description
Resolved boundary config with pre-compiled glob matchers.
Fields§
§zones: Vec<ResolvedZone>Zones with compiled glob matchers for fast file classification.
rules: Vec<ResolvedBoundaryRule>Rules indexed by source zone name.
logical_groups: Vec<LogicalGroup>Pre-expansion logical groups captured during expand_auto_discover,
preserved here for observability (fallow list --boundaries --format json). One entry per autoDiscover-bearing zone in user-declaration
order. Empty unless the user (or a preset) wrote at least one
autoDiscover. See LogicalGroup for the per-entry shape.
Implementations§
Source§impl ResolvedBoundaryConfig
impl ResolvedBoundaryConfig
Sourcepub fn is_empty(&self) -> bool
pub fn is_empty(&self) -> bool
Whether any boundaries are configured.
Considers logical_groups too: when every autoDiscover zone
produced zero children, zones is empty but the user authored a
boundaries section that should still be surfaced (so fallow list --boundaries can render the Empty / InvalidPath status to the
user). Without this, the whole boundaries block silently disappears
from the output the moment discovery finds nothing.
Sourcepub fn classify_zone(&self, relative_path: &str) -> Option<&str>
pub fn classify_zone(&self, relative_path: &str) -> Option<&str>
Classify a file path into a zone. Returns the first matching zone name. Path should be relative to the project root with forward slashes.
When a zone declares a root (subtree scope), the path must start
with that prefix and the prefix is stripped before glob matching;
otherwise the zone is skipped. Zones without a root keep
project-root-relative behavior.
Sourcepub fn is_import_allowed(&self, from_zone: &str, to_zone: &str) -> bool
pub fn is_import_allowed(&self, from_zone: &str, to_zone: &str) -> bool
Check if an import from from_zone to to_zone is allowed.
Returns true if the import is permitted.
Sourcepub fn is_type_only_allowed(&self, from_zone: &str, to_zone: &str) -> bool
pub fn is_type_only_allowed(&self, from_zone: &str, to_zone: &str) -> bool
Check whether a type-only import from from_zone to to_zone is
permitted by the rule’s allowTypeOnly list. Only consulted by the
boundary detector after is_import_allowed has already returned
false; the caller is responsible for verifying the import is in
fact type-only (all symbols on the edge carry the type-only flag).
Returns false when no rule exists for from_zone, since rule-less
zones are unrestricted and is_import_allowed short-circuits before
this is called.