pub enum MethodOutput {
Valid,
Invalid(InvalidRecord),
NoSuchMethod,
Unchecked,
}Expand description
What checking a body against a method’s declared schema found.
Four outcomes rather than a Result, because two of the failures are
about the catalog rather than about the body: a method nobody vendored
and a method that declares no schema are both silence, and silence that
reads as success is how a conformance suite stops conforming.
Variants§
Valid
The body satisfies the schema.
Invalid(InvalidRecord)
The body does not.
NoSuchMethod
The catalog holds no method by that name.
Unchecked
The method declares no JSON schema for this body.
Implementations§
Source§impl MethodOutput
impl MethodOutput
Sourcepub fn expect_valid(self, what: &str)
pub fn expect_valid(self, what: &str)
Panics unless the body was checked and satisfied its schema.
For a test that means to assert conformance: it fails on a body that is wrong and on one that was never checked, which is the outcome a bare boolean would hide.
Trait Implementations§
Source§impl Clone for MethodOutput
impl Clone for MethodOutput
Source§fn clone(&self) -> MethodOutput
fn clone(&self) -> MethodOutput
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for MethodOutput
impl Debug for MethodOutput
Source§impl PartialEq for MethodOutput
impl PartialEq for MethodOutput
Source§fn eq(&self, other: &MethodOutput) -> bool
fn eq(&self, other: &MethodOutput) -> bool
Tests for
self and other values to be equal, and is used by ==.impl Eq for MethodOutput
impl StructuralPartialEq for MethodOutput
Auto Trait Implementations§
impl Freeze for MethodOutput
impl RefUnwindSafe for MethodOutput
impl Send for MethodOutput
impl Sync for MethodOutput
impl Unpin for MethodOutput
impl UnsafeUnpin for MethodOutput
impl UnwindSafe for MethodOutput
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
Mutably borrows from an owned value. Read more
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
Checks if this value is equivalent to the given key. Read more
§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
Compare self to
key and return true if they are equal.