pub struct ComponentGraphConfigBuilder { /* private fields */ }Expand description
Builder for ComponentGraphConfig.
Each method sets the corresponding option and returns self, so calls
can be chained. Call build to obtain the final
ComponentGraphConfig.
Implementations§
Source§impl ComponentGraphConfigBuilder
impl ComponentGraphConfigBuilder
Sourcepub fn allow_component_validation_failures(self, value: bool) -> Self
pub fn allow_component_validation_failures(self, value: bool) -> Self
When true, the graph is built even if per-component validation
rules fail; failures are reported as tracing::warn! instead of
returning an error.
Sourcepub fn allow_unconnected_components(self, value: bool) -> Self
pub fn allow_unconnected_components(self, value: bool) -> Self
When true, components that are not reachable from the root are
permitted; otherwise the graph fails to build.
Sourcepub fn allow_unspecified_inverters(self, value: bool) -> Self
pub fn allow_unspecified_inverters(self, value: bool) -> Self
When true, inverters with InverterType::Unspecified are
treated as battery inverters instead of being rejected.
Sourcepub fn disable_fallback_components(self, value: bool) -> Self
pub fn disable_fallback_components(self, value: bool) -> Self
When true, generated formulas omit fallback components.
Sourcepub fn include_phantom_loads_in_consumer_formula(self, value: bool) -> Self
pub fn include_phantom_loads_in_consumer_formula(self, value: bool) -> Self
Controls how the consumer formula handles meters with successors, which can carry loads not represented in the graph (phantom loads).
When true, phantom loads are included by subtracting successor
meter measurements from their predecessor meter’s measurements.
When false, the consumer formula instead excludes production and
battery components from the grid measurements.
Sourcepub fn prefer_meters_in_component_formulas(self, value: bool) -> Self
pub fn prefer_meters_in_component_formulas(self, value: bool) -> Self
Sets the global meter-vs-device source preference for the
per-category formulas. See the field-level docs on
ComponentGraphConfig for the exact list of affected formulas.
Sourcepub fn formula_overrides(self, overrides: FormulaOverrides) -> Self
pub fn formula_overrides(self, overrides: FormulaOverrides) -> Self
Sets the per-formula overrides for the meter/device preference.
Each override, when Some(_), takes precedence over
prefer_meters_in_component_formulas
for that formula.
Sourcepub fn build(self) -> ComponentGraphConfig
pub fn build(self) -> ComponentGraphConfig
Consumes the builder and returns the resulting ComponentGraphConfig.
Trait Implementations§
Source§impl Clone for ComponentGraphConfigBuilder
impl Clone for ComponentGraphConfigBuilder
Source§fn clone(&self) -> ComponentGraphConfigBuilder
fn clone(&self) -> ComponentGraphConfigBuilder
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more