pub struct DiscreteValueRule { /* private fields */ }
Expand description
§Rule
A Rule may have multiple states that affect agent behavior while it is driving through the rule’s zone. The possible states of a Rule must be semantically coherent. The current state of a Rule is given by a [RuleStateProvider]. States can be:
- range based (RangeValueRule).
- discrete (DiscreteValueRule).
§DiscreteValueRule
DiscreteValues are defined by a string value. Semantics of this rule are based on all possible values that this DiscreteValueRule::type_id could have (as specified by RuleRegistry::FindRuleByType()), not only the subset of values that a specific instance of this rule can be in.
Implementations§
Source§impl DiscreteValueRule
impl DiscreteValueRule
Sourcepub fn type_id(&self) -> String
pub fn type_id(&self) -> String
Returns the type of the rule as a string. Example: “right-of-way-rule-type-id”, “direction-usage-rule-type-id”
Sourcepub fn zone(&self) -> LaneSRoute
pub fn zone(&self) -> LaneSRoute
Returns a [LaneSRoute] that represents the zone that the rule applies to.
Sourcepub fn states(&self) -> Vec<DiscreteValue>
pub fn states(&self) -> Vec<DiscreteValue>
Returns the states of the rule.
Auto Trait Implementations§
impl Freeze for DiscreteValueRule
impl RefUnwindSafe for DiscreteValueRule
impl !Send for DiscreteValueRule
impl !Sync for DiscreteValueRule
impl Unpin for DiscreteValueRule
impl UnwindSafe for DiscreteValueRule
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more