pub enum BenchmarkPolicy {
Required,
RequiredWhen {
precondition: BenchmarkPrecondition,
},
Waived {
reason: WaiverReason,
},
}Expand description
Whether the capability is a benchmark target. Required is the default and the norm:
every executable capability is timed directly and through every transport it is
exposed on, with the cases its input type provides.
Variants§
Required
Timed directly and through every exposure; coverage fails without a case.
RequiredWhen
Required exactly like Required in a repository where the precondition holds, and
reported as inapplicable — never covered, never waived — where it does not. Not a
waiver: with the precondition met and no case, the requirement is missing.
Fields
precondition: BenchmarkPreconditionWhat the repository must hold.
Waived
Not timed, for the typed reason; coverage reports it as waived, never as covered.
Fields
reason: WaiverReasonWhy.
Implementations§
Source§impl BenchmarkPolicy
impl BenchmarkPolicy
Sourcepub fn is_target(self) -> bool
pub fn is_target(self) -> bool
Is the capability a benchmark target at all — required, unconditionally or on a precondition? Only a waiver says no.
A conditional requirement is a target even where its precondition does not hold: being inapplicable to one repository is not the same as being waived, and coverage only decides applicability after this has said the capability is timed at all.
use majordomus_cli::capability::{BenchmarkPolicy, BenchmarkPrecondition, WaiverReason};
assert!(BenchmarkPolicy::Required.is_target());
// conditional, and still a target: the precondition decides applicability, not this
let conditional = BenchmarkPolicy::RequiredWhen {
precondition: BenchmarkPrecondition::PlanHoldsAnIssue,
};
assert!(conditional.is_target());
// only a waiver takes a capability out of the benchmark set
let waived = BenchmarkPolicy::Waived { reason: WaiverReason::PublishedHistory };
assert!(!waived.is_target());Trait Implementations§
Source§impl Clone for BenchmarkPolicy
impl Clone for BenchmarkPolicy
Source§fn clone(&self) -> BenchmarkPolicy
fn clone(&self) -> BenchmarkPolicy
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for BenchmarkPolicy
Source§impl Debug for BenchmarkPolicy
impl Debug for BenchmarkPolicy
Source§impl<'de> Deserialize<'de> for BenchmarkPolicy
impl<'de> Deserialize<'de> for BenchmarkPolicy
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for BenchmarkPolicy
Source§impl JsonSchema for BenchmarkPolicy
impl JsonSchema for BenchmarkPolicy
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
$ref keyword. Read moreSource§impl PartialEq for BenchmarkPolicy
impl PartialEq for BenchmarkPolicy
Source§fn eq(&self, other: &BenchmarkPolicy) -> bool
fn eq(&self, other: &BenchmarkPolicy) -> bool
self and other values to be equal, and is used by ==.Source§impl Serialize for BenchmarkPolicy
impl Serialize for BenchmarkPolicy
impl StructuralPartialEq for BenchmarkPolicy
Auto Trait Implementations§
impl Freeze for BenchmarkPolicy
impl RefUnwindSafe for BenchmarkPolicy
impl Send for BenchmarkPolicy
impl Sync for BenchmarkPolicy
impl Unpin for BenchmarkPolicy
impl UnsafeUnpin for BenchmarkPolicy
impl UnwindSafe for BenchmarkPolicy
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.