pub struct RangeValueRuleStateProvider<'a> { /* private fields */ }Expand description
Provides the dynamic state of RangeValueRules.
While a RoadRulebook provides the static definitions of rules, a
RangeValueRuleStateProvider provides the current state of those rules
at runtime. This allows for querying what state a rule is currently in,
which is essential for dynamic systems where rule states can change over
time (e.g., variable speed limits based on types of roads).
Implementations§
Source§impl<'a> RangeValueRuleStateProvider<'a>
impl<'a> RangeValueRuleStateProvider<'a>
Sourcepub fn get_state_by_rule_id(
&self,
rule_id: &String,
) -> Option<StateProviderQuery<Range>>
pub fn get_state_by_rule_id( &self, rule_id: &String, ) -> Option<StateProviderQuery<Range>>
Gets a state from the provider based on it’s rule_id.
§Arguments
rule_id- A Rule ID.
§Returns
An Option containing the StateProviderQuery with a Range if the rule_id matches with any rule.
Otherwise, None is returned.
Sourcepub fn get_state_by_rule_type(
&self,
road_position: &RoadPosition,
rule_type: RuleType,
tolerance: f64,
) -> Option<StateProviderQuery<Range>>
pub fn get_state_by_rule_type( &self, road_position: &RoadPosition, rule_type: RuleType, tolerance: f64, ) -> Option<StateProviderQuery<Range>>
Gets a state from the provider if there is a rule_type in the received road_position.
§Arguments
road_position- A position in the road geometry.rule_type- A Rule Type.tolerance- The tolerance in which to look for the Rule of typerule_typearound theroad_position.
§Returns
An Option containing the StateProviderQuery with a Range if rule_type matches with any rule’s type near road_position.
Otherwise, None is returned.