Skip to main content

WyomingError

Enum WyomingError 

Source
#[non_exhaustive]
pub enum WyomingError { Request { what: &'static str, value: String, }, Net(NetError), Missing { field: String, }, Units { field: &'static str, found: String, expected: &'static str, }, Row { line: usize, reason: String, }, NoGround { line: usize, }, GroundMisfit { line: usize, first: usize, }, Misfit { after: usize, line: usize, }, }
Expand description

Why a Wyoming request or answer was refused.

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.
§

Request

A request field is outside its range.

Fields

§what: &'static str

The field.

§value: String

Its value, cut to 40 characters.

§

Net(NetError)

The fetch failed.

§

Missing

A column is absent.

Fields

§field: String

The column, or header when there is no header line.

§

Units

A column is in a unit other than the one required.

Fields

§field: &'static str

The column.

§found: String

The unit it came in, cut to 40 characters.

§expected: &'static str

The unit required.

§

Row

A line can’t be read.

Fields

§line: usize

The line, counting the header as line 1.

§reason: String

What is wrong with it.

§

NoGround

There is no ground: no row, or a first row missing a value or with one out of range.

Fields

§line: usize

The line of the first row, counting the header as line 1.

§

GroundMisfit

A chain of rows that fit, starting after the ground among the rows it could reach, beats every chain from the ground: more rows, or as many whose layers fit more closely. The ground is taken as wrong, and it can’t be left out.

Fields

§line: usize

The ground’s line, counting the header as line 1.

§first: usize

The first row of that chain.

§

Misfit

More than MAX_MISFITS rows follow the end of the chain of rows that fit: its end, or all of them, are wrong, or rows with no temperature leave a layer too thick to check.

Fields

§after: usize

The chain’s end, counting the header as line 1.

§line: usize

The first row with a pressure, height and temperature within the bounds after it.

Trait Implementations§

Source§

impl Debug for WyomingError

Source§

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

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

impl Display for WyomingError

Source§

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

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

impl Error for WyomingError

Source§

fn source(&self) -> Option<&(dyn Error + 'static)>

Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§

fn description(&self) -> &str

👎Deprecated since 1.42.0:

use the Display impl or to_string()

1.0.0 · Source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0:

replaced by Error::source, which can support downcasting

Source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type-based access to context intended for error reports. Read more
Source§

impl From<NetError> for WyomingError

Source§

fn from(source: NetError) -> Self

Converts to this type from the input type.

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
§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

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.

§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

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.