Skip to main content

LogicalGroup

Struct LogicalGroup 

Source
pub struct LogicalGroup {
    pub name: String,
    pub children: Vec<String>,
    pub auto_discover: Vec<String>,
    pub authored_rule: Option<AuthoredRule>,
    pub fallback_zone: Option<String>,
    pub source_zone_index: usize,
    pub status: LogicalGroupStatus,
    pub merged_from: Option<Vec<usize>>,
    pub original_zone_root: Option<String>,
    pub child_source_indices: Vec<usize>,
}
Expand description

A user-declared zone that fanned out into one or more child zones via autoDiscover. Surfaced verbatim through fallow list --boundaries --format json so consumers (config UIs, Sankey renderers, agent-driven config tooling, dashboards) can reconstruct the original grouping intent after expansion has flattened the parent name out of zones[].

Fields§

§name: String

Logical parent zone name as authored by the user (e.g. "features").

§children: Vec<String>

Discovered child zone names in stable directory-sorted order (e.g. ["features/auth", "features/billing"]). Empty when the parent directory was empty or unreadable; status discriminates the two.

§auto_discover: Vec<String>

The exact autoDiscover strings the user wrote, preserved verbatim (no normalization). Round-trip tooling depends on byte-exact match against the user’s config source.

§authored_rule: Option<AuthoredRule>

Pre-expansion rule keyed on this parent zone name, captured before expand_auto_discover rewrote it into per-child rules. None when the user wrote no rule for the parent (the children are then unrestricted unless a per-child rule exists).

§fallback_zone: Option<String>

When the parent zone also carried explicit patterns, it stayed in zones[] after expansion as a fallback classifier. This is its name (always equal to Self::name). None when the parent had no patterns and was dropped from zones[] entirely. Lets consumers wire the logical-group entry to its zone twin without name-matching heuristics.

§source_zone_index: usize

Position of the parent zone in the user’s pre-expansion zones[] array. Enables byte-accurate config patches by agent tooling without re-parsing the user’s config source.

§status: LogicalGroupStatus

Why Self::children is what it is.

§merged_from: Option<Vec<usize>>

Parent zone indices whose declarations were merged into this group because they shared a name ({ name: "features", autoDiscover: [...] } declared twice). None on the common case (single declaration); Some([i, j, ...]) when at least two declarations were merged. The FIRST entry equals Self::source_zone_index; subsequent entries are the positions of the additional declarations in user-declaration order. Surfaced in JSON so consumers (config-edit agents, config-hygiene dashboards) can detect duplicates that tracing::warn! would otherwise hide from --format json consumption.

§original_zone_root: Option<String>

The parent zone’s root (subtree scope) as the user authored it, echoed onto the logical group so monorepo-aware tooling can tell whether root was set on the parent (and inherited by every discovered child) or set per-child. None when the parent had no root field. The string is verbatim from the user’s config (not the post-normalize_zone_root form) for byte-exact round-trip.

§child_source_indices: Vec<usize>

For each entry in Self::children, the index into Self::auto_discover of the path that produced it (or the FIRST path that produced it when multiple autoDiscover entries each yield the same child name). Empty when only one autoDiscover path was authored (every child trivially maps to index 0); populated only when the parent has two or more autoDiscover entries so consumers can attribute children to specific source directories. The length equals children.len() when populated.

#[serde(default)] pairs with skip_serializing_if so the JSON runtime omits this field on the common single-path case AND the derived schema marks it optional (schemars 1 promotes any field with a serde(default) attribute out of required).

Trait Implementations§

Source§

impl Clone for LogicalGroup

Source§

fn clone(&self) -> LogicalGroup

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for LogicalGroup

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl JsonSchema for LogicalGroup

Source§

fn schema_name() -> Cow<'static, str>

The name of the generated JSON Schema. Read more
Source§

fn schema_id() -> Cow<'static, str>

Returns a string that uniquely identifies the schema produced by this type. Read more
Source§

fn json_schema(generator: &mut SchemaGenerator) -> Schema

Generates a JSON Schema for this type. Read more
Source§

fn inline_schema() -> bool

Whether JSON Schemas generated for this type should be included directly in parent schemas, rather than being re-used where possible using the $ref keyword. Read more
Source§

impl Serialize for LogicalGroup

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more