#[non_exhaustive]pub struct Corpus {
pub header: Header,
pub cases: Vec<Case>,
}Expand description
A whole corpus (record.md §1).
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.header: HeaderThe header line (record.md §2).
cases: Vec<Case>The cases, in file order, which is byte order of their names.
Implementations§
Source§impl Corpus
impl Corpus
Sourcepub fn surface(&self) -> Option<BTreeSet<&str>>
pub fn surface(&self) -> Option<BTreeSet<&str>>
The keys of the BASELINE_CASE key lines: every key ADP modeled when the corpus was recorded.
The set is fixed at recording time. It changes only when the corpus is re-recorded, never when ADP’s support for a key changes afterwards. Keys are lowercase, as the reader requires.
Returns None when the baseline case did not start, so a missing baseline cannot pass as an
empty set. crate::read rejects a corpus without a baseline case, but not one whose
baseline hit a startup error.
Sourcepub fn first_snapshot(&self, case: &str) -> Option<BTreeMap<&str, &Setting>>
pub fn first_snapshot(&self, case: &str) -> Option<BTreeMap<&str, &Setting>>
Rebuilds a case’s first snapshot, key to setting, by the three layers of record.md §3.2:
the baseline-default case’s key-line snapshots, then the case’s side_effects (an absent
element removes the key), then the case’s own key-line snapshots (null removes the key).
Keys the corpus neither models nor saw change are not in the result. Returns None when the
case does not exist or did not start. Without a started baseline case, layer 1 is empty.