pub enum Requirement<S> {
Unconstrained,
Min(S),
Forbidden,
}Expand description
Spec D3: the per-language requirement domain Req_L, a finite
chain under the strictness order ⊑ (spec L1). The derived
Ord follows declaration order, which is exactly that chain:
unconstrained ⊑ [⊥_L] ⊑ ... ⊑ [max Level_L] ⊑ forbidden (the
tests verify the derived order against D3’s case-by-case
definition by exhaustive enumeration). Populating the reserved
interface max later is a domain swap to the interval domain of
D4’s remark, not a signature change.
Variants§
Unconstrained
Spec D3: imposes nothing on consumers.
Min(S)
Spec D3: [m] - requires a consumer level of at least the
carried minimum.
Forbidden
Spec D3: unsatisfiable.
Implementations§
Source§impl<S: Copy + Ord> Requirement<S>
impl<S: Copy + Ord> Requirement<S>
Sourcepub fn join(self, other: Self) -> Self
pub fn join(self, other: Self) -> Self
Spec D4: the join r1 ⊔ r2 is the ⊑-maximum of the two
requirements (well-defined because the chain is total, spec
L1; a bounded join-semilattice by spec L2).
Sourcepub fn join_all(requirements: impl IntoIterator<Item = Self>) -> Self
pub fn join_all(requirements: impl IntoIterator<Item = Self>) -> Self
Spec D4: the set join ⨆ S over a finite (multi)set, with
⨆ ∅ = unconstrained.
Sourcepub fn satisfied_by(self, level: S) -> bool
pub fn satisfied_by(self, level: S) -> bool
Spec D11: satisfies(c, L, r) for a consumer whose effective
compile level in L is level.
Sourcepub fn sat(self, levels: &[S]) -> Vec<S>
pub fn sat(self, levels: &[S]) -> Vec<S>
Spec D12: the satisfaction set Sat_L(r), as the sub-slice
of levels a consumer may compile at. levels must be the
full chain Level_L of spec D2 (CStandard::ALL /
CxxStandard::ALL).
Trait Implementations§
Source§impl<S: Clone> Clone for Requirement<S>
impl<S: Clone> Clone for Requirement<S>
Source§fn clone(&self) -> Requirement<S>
fn clone(&self) -> Requirement<S>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl<S: Copy> Copy for Requirement<S>
Source§impl<S: Debug> Debug for Requirement<S>
impl<S: Debug> Debug for Requirement<S>
impl<S: Eq> Eq for Requirement<S>
Source§impl<S: Hash> Hash for Requirement<S>
impl<S: Hash> Hash for Requirement<S>
Source§impl<S: Ord> Ord for Requirement<S>
impl<S: Ord> Ord for Requirement<S>
Source§fn cmp(&self, other: &Requirement<S>) -> Ordering
fn cmp(&self, other: &Requirement<S>) -> Ordering
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl<S: PartialEq> PartialEq for Requirement<S>
impl<S: PartialEq> PartialEq for Requirement<S>
Source§fn eq(&self, other: &Requirement<S>) -> bool
fn eq(&self, other: &Requirement<S>) -> bool
self and other values to be equal, and is used by ==.Source§impl<S: PartialOrd> PartialOrd for Requirement<S>
impl<S: PartialOrd> PartialOrd for Requirement<S>
impl<S: PartialEq> StructuralPartialEq for Requirement<S>
Auto Trait Implementations§
impl<S> Freeze for Requirement<S>where
S: Freeze,
impl<S> RefUnwindSafe for Requirement<S>where
S: RefUnwindSafe,
impl<S> Send for Requirement<S>where
S: Send,
impl<S> Sync for Requirement<S>where
S: Sync,
impl<S> Unpin for Requirement<S>where
S: Unpin,
impl<S> UnsafeUnpin for Requirement<S>where
S: UnsafeUnpin,
impl<S> UnwindSafe for Requirement<S>where
S: UnwindSafe,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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.