pub struct SelectedRules {
pub by_element: BTreeMap<ElementName, RuleIdx>,
pub overridden_native: BTreeSet<ElementName>,
}Expand description
The lowering rules one backend uses in one plan, one rule per element.
Lowering rule selection chooses one rule per element and backend in a fixed order: the rule the request prefers by name, else the backend’s native emission, else a rule marked default on that backend, else a rule marked default everywhere, else the sole candidate. The module documentation describes which rules are candidates and when the choice fails.
A backend’s lowering stage reads this value to work out what it needs, and the
lowering driver reads it at every node to find the rule to call. Read it from
Plan::selection or, while the plan is
being built, from
PlanCx::lowering_selection.
The rule indices (RuleIdx) are numbers of the registry the plan was built
against, and mean nothing with any other registry.
Fields§
§by_element: BTreeMap<ElementName, RuleIdx>The rule chosen for each element. An element the backend writes natively has no entry, unless the request preferred a rule for it.
overridden_native: BTreeSet<ElementName>The elements the backend writes natively for which the request preferred a rule, which is used instead of the native emission.
Implementations§
Trait Implementations§
Source§impl Clone for SelectedRules
impl Clone for SelectedRules
Source§impl Debug for SelectedRules
impl Debug for SelectedRules
Source§impl Default for SelectedRules
impl Default for SelectedRules
impl Eq for SelectedRules
Source§impl PartialEq for SelectedRules
impl PartialEq for SelectedRules
impl StructuralPartialEq for SelectedRules
Auto Trait Implementations§
impl Forget for SelectedRules
impl Freeze for SelectedRuleswhere
*const LeafNode<ElementName, RuleIdx> is !null: Freeze,
PhantomData<(Owned, LeafOrInternal)>: Freeze,
PhantomData<Box<(ElementName, RuleIdx)>>: Freeze,
*const LeafNode<ElementName, SetValZST> is !null: Freeze,
PhantomData<Box<(ElementName, SetValZST)>>: Freeze,
impl Move for SelectedRules
impl RefUnwindSafe for SelectedRules
impl Send for SelectedRuleswhere
NodeRef<Owned, ElementName, RuleIdx, LeafOrInternal>: Send,
BoxRaw<(ElementName, RuleIdx)>: Send,
NodeRef<Owned, ElementName, SetValZST, LeafOrInternal>: Send,
BoxRaw<(ElementName, SetValZST)>: Send,
impl Sync for SelectedRuleswhere
NodeRef<Owned, ElementName, RuleIdx, LeafOrInternal>: Sync,
BoxRaw<(ElementName, RuleIdx)>: Sync,
NodeRef<Owned, ElementName, SetValZST, LeafOrInternal>: Sync,
BoxRaw<(ElementName, SetValZST)>: Sync,
impl Unpin for SelectedRuleswhere
*const LeafNode<ElementName, RuleIdx> is !null: Unpin,
Box<(ElementName, RuleIdx)>: Unpin,
*const LeafNode<ElementName, SetValZST> is !null: Unpin,
Box<(ElementName, SetValZST)>: Unpin,
impl UnsafeUnpin for SelectedRuleswhere
*const LeafNode<ElementName, RuleIdx> is !null: UnsafeUnpin,
PhantomData<(Owned, LeafOrInternal)>: UnsafeUnpin,
PhantomData<Box<(ElementName, RuleIdx)>>: UnsafeUnpin,
*const LeafNode<ElementName, SetValZST> is !null: UnsafeUnpin,
PhantomData<Box<(ElementName, SetValZST)>>: UnsafeUnpin,
impl UnwindSafe for SelectedRules
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CheckedAs for T
impl<T> CheckedAs for T
Source§fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
Source§impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
Source§fn checked_cast_from(src: Src) -> Option<Dst>
fn checked_cast_from(src: Src) -> Option<Dst>
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more