pub struct CaseResult { /* private fields */ }Expand description
One scored eval case: the expected polarity, the polarity the grader actually returned, whether they matched, and the grader’s verbatim feedback message.
matched is derived at construction from the two polarities (score_case),
never set independently (§1.1): a result cannot claim a match its polarities
contradict. The serialized shape — expected, actual, matched,
feedback_message — is the per-case artifact a built site embeds without
re-scoring; feedback_message is a plain String (never Option), so the
key is always present on the wire (§1.1).
Implementations§
Source§impl CaseResult
impl CaseResult
Sourcepub fn score(expected: ExpectedVerdict, actual: &Verdict) -> Self
pub fn score(expected: ExpectedVerdict, actual: &Verdict) -> Self
Score a case: reduce the runtime actual verdict to its polarity, derive
matched from it and expected, and capture the verdict’s verbatim
learner-facing message. The only constructor, so a matched flag
inconsistent with the polarities is unrepresentable.
Sourcepub fn expected(&self) -> &ExpectedVerdict
pub fn expected(&self) -> &ExpectedVerdict
The polarity the case’s author expected the grader to return.
Sourcepub fn actual(&self) -> &ExpectedVerdict
pub fn actual(&self) -> &ExpectedVerdict
The polarity the grader actually returned for the submission.
Sourcepub fn feedback_message(&self) -> &str
pub fn feedback_message(&self) -> &str
The learner-facing feedback the grader produced for this case, verbatim.
Trait Implementations§
Source§impl Clone for CaseResult
impl Clone for CaseResult
Source§fn clone(&self) -> CaseResult
fn clone(&self) -> CaseResult
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for CaseResult
impl Debug for CaseResult
Source§impl PartialEq for CaseResult
impl PartialEq for CaseResult
Source§impl Serialize for CaseResult
impl Serialize for CaseResult
impl Eq for CaseResult
impl StructuralPartialEq for CaseResult
Auto Trait Implementations§
impl Freeze for CaseResult
impl RefUnwindSafe for CaseResult
impl Send for CaseResult
impl Sync for CaseResult
impl Unpin for CaseResult
impl UnwindSafe for CaseResult
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,
§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
§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.