pub enum DefaultMark {
Everywhere,
OnBackends(Vec<BackendName>),
Never,
}Expand description
The default mark of a lowering rule: on which backends the rule is chosen for its element when the plan request does not prefer a rule by name.
The plan reads the mark after the plan request’s preferences and before
the case of a single candidate; see the module
documentation for the whole order. Usually the
rule of the feature that declares the element is marked
Everywhere, a rule written for one backend is
marked OnBackends with that backend, and an
alternative that a caller must ask for by name is marked
Never.
Variants§
Everywhere
The element’s default rule on every backend.
OnBackends(Vec<BackendName>)
The default on the listed backends only, ranked above a rule marked
Everywhere, and never a candidate on any
other backend: not as the only rule for its element, and not when a
plan request prefers it by name. The mark states where the rule
belongs, because a rule written for one backend stages that backend’s
own elements.
Never
Never a default: chosen only when the plan request prefers it by name, or when it is the element’s only rule. The mark restricts precedence and not place, so such a rule is a candidate on every backend.
Implementations§
Source§impl DefaultMark
impl DefaultMark
Sourcepub fn is_general(&self) -> bool
pub fn is_general(&self) -> bool
Returns whether the mark is Everywhere:
the rule is the default on every backend.
Sourcepub fn is_specific_to(&self, backend: &BackendName) -> bool
pub fn is_specific_to(&self, backend: &BackendName) -> bool
Returns whether the mark is OnBackends
and lists backend.
Sourcepub fn takes_part_on(&self, backend: &BackendName) -> bool
pub fn takes_part_on(&self, backend: &BackendName) -> bool
Returns whether a rule with this mark may be chosen on backend at
all.
OnBackends states where the rule
belongs, not merely where it ranks first: a rule marked for listed
backends is never a candidate on another backend, not even as the
element’s only rule and not even when a plan request prefers it by
name. A rule written for one backend produces that backend’s own
elements, which are wrong on any other backend.
Never restricts precedence and not place, so
such a rule may be chosen on every backend as the only candidate.
Trait Implementations§
Source§impl Clone for DefaultMark
impl Clone for DefaultMark
Source§impl Debug for DefaultMark
impl Debug for DefaultMark
impl Eq for DefaultMark
Source§impl PartialEq for DefaultMark
impl PartialEq for DefaultMark
impl StructuralPartialEq for DefaultMark
Auto Trait Implementations§
impl Forget for DefaultMark
impl Freeze for DefaultMark
impl Move for DefaultMark
impl RefUnwindSafe for DefaultMark
impl Send for DefaultMark
impl Sync for DefaultMark
impl Unpin for DefaultMark
impl UnsafeUnpin for DefaultMark
impl UnwindSafe for DefaultMark
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