pub enum EvidenceProducer {
Suite,
Crate,
Coverage,
}Expand description
Which report an entry of a run belongs to: the suite’s TSV, cargo test’s output, or a
coverage summary.
The serde word is the word a person types and a document carries (suite, crate,
coverage), and EvidenceProducer::parse reads exactly those three back. A word that
names no report is not a producer, so a misspelled one is refused where it is read
rather than guessed at.
use majordomus_cli::evidence::EvidenceProducer;
assert_eq!(EvidenceProducer::parse("crate"), Some(EvidenceProducer::Crate));
assert_eq!(EvidenceProducer::Coverage.as_str(), "coverage");
assert_eq!(serde_json::to_value(EvidenceProducer::Suite).unwrap(), "suite");
assert_eq!(EvidenceProducer::parse("Suite"), None, "the word is exact");Variants§
Suite
The suite runner’s TSV report (MJ_TEST_REPORT of test/run.sh).
Crate
cargo test’s output: one result line per test binary.
Coverage
A coverage summary (scripts/rust-coverage --summary-json).
Implementations§
Source§impl EvidenceProducer
impl EvidenceProducer
Sourcepub fn parse(word: &str) -> Option<EvidenceProducer>
pub fn parse(word: &str) -> Option<EvidenceProducer>
The producer a word names, or None when it names none.
The three words are exact: no case folding and no trimming, because every caller reads a word a program wrote and a near-miss is a defect to name, not to absorb.
use majordomus_cli::evidence::EvidenceProducer;
assert_eq!(EvidenceProducer::parse("suite"), Some(EvidenceProducer::Suite));
assert_eq!(EvidenceProducer::parse(" suite"), None);
assert_eq!(EvidenceProducer::parse(""), None);Sourcepub fn as_str(self) -> &'static str
pub fn as_str(self) -> &'static str
The word this producer is written as: the serde word, and what
EvidenceProducer::parse reads back.
use majordomus_cli::evidence::EvidenceProducer;
assert_eq!(EvidenceProducer::Crate.as_str(), "crate");
assert_eq!(
EvidenceProducer::parse(EvidenceProducer::Suite.as_str()),
Some(EvidenceProducer::Suite)
);Trait Implementations§
Source§impl Clone for EvidenceProducer
impl Clone for EvidenceProducer
Source§fn clone(&self) -> EvidenceProducer
fn clone(&self) -> EvidenceProducer
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 EvidenceProducer
Source§impl Debug for EvidenceProducer
impl Debug for EvidenceProducer
Source§impl<'de> Deserialize<'de> for EvidenceProducer
impl<'de> Deserialize<'de> for EvidenceProducer
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 EvidenceProducer
Source§impl Hash for EvidenceProducer
impl Hash for EvidenceProducer
Source§impl JsonSchema for EvidenceProducer
impl JsonSchema for EvidenceProducer
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 Ord for EvidenceProducer
impl Ord for EvidenceProducer
Source§fn cmp(&self, other: &EvidenceProducer) -> Ordering
fn cmp(&self, other: &EvidenceProducer) -> 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 PartialEq for EvidenceProducer
impl PartialEq for EvidenceProducer
Source§fn eq(&self, other: &EvidenceProducer) -> bool
fn eq(&self, other: &EvidenceProducer) -> bool
self and other values to be equal, and is used by ==.Source§impl PartialOrd for EvidenceProducer
impl PartialOrd for EvidenceProducer
Source§impl Serialize for EvidenceProducer
impl Serialize for EvidenceProducer
impl StructuralPartialEq for EvidenceProducer
Auto Trait Implementations§
impl Freeze for EvidenceProducer
impl RefUnwindSafe for EvidenceProducer
impl Send for EvidenceProducer
impl Sync for EvidenceProducer
impl Unpin for EvidenceProducer
impl UnsafeUnpin for EvidenceProducer
impl UnwindSafe for EvidenceProducer
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<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
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.