Skip to main content

Verdict

Enum Verdict 

Source
#[non_exhaustive]
pub enum Verdict { Conformant, NonConformant(Malformed), Undetermined(Unsupported), OutOfScope(String), }
Expand description

What can be said about a container after reading it.

Four answers rather than two. SPEC 2.2 and SPEC 3 require that a container whose metadata member cannot be read is reported as neither conformant nor non-conformant, and SPEC 2.4 puts a container declaring another version outside this document’s conformance question rather than failing it. A yes-or-no return could say neither thing.

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

Conformant

Conformant to the version this build implements.

§

NonConformant(Malformed)

Not conformant, and this is the rule it breaks.

§

Undetermined(Unsupported)

The metadata member could not be read, so conformance cannot be established from the file (SPEC 2.2). Not a failure, and not a pass.

§

OutOfScope(String)

Declares a slipcase_version this build does not implement (SPEC 2.4). Outside the question rather than failing it.

Implementations§

Source§

impl Verdict

Source

pub fn is_conformant(&self) -> bool

Whether this is Verdict::Conformant.

Deliberately not is_ok: the other three are not failures in the same sense, and two of them are not failures at all.

Trait Implementations§

Source§

impl Debug for Verdict

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Display for Verdict

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.