Skip to main content

GrassError

Enum GrassError 

Source
pub enum GrassError {
    Tiles {
        x: u32,
        z: u32,
    },
    Metres {
        what: &'static str,
        metres: f32,
    },
    EmptyMap {
        what: &'static str,
        width: u32,
        height: u32,
    },
    MapSize {
        what: &'static str,
        width: u32,
        height: u32,
        expected: usize,
        found: usize,
    },
    Height {
        height: f32,
        at: usize,
    },
    Blades {
        rows: usize,
    },
    Blade {
        row: usize,
        what: &'static str,
        value: f32,
    },
    Shells {
        count: u32,
    },
    BladeLod {
        distance: f32,
        band: f32,
    },
}
Expand description

Why a field could not be built.

One variant per way of being wrong rather than one string, on crcbl_wind::WindError’s terms: a caller can tell a map that has not been filled in from one that is the wrong shape, and the message names the numbers it refused.

Variants§

§

Tiles

A field with no tiles along one of its axes, or more than MAX_TILES of them.

Fields

§x: u32

Tiles along +X.

§z: u32

Tiles along +Z.

§

Metres

A tile side, a reach or a texel scale that is not a positive finite number of metres.

Fields

§what: &'static str

Which number was refused.

§metres: f32

What was offered, as its bits printed — a NaN reaches here too.

§

EmptyMap

A map with a zero dimension.

Fields

§what: &'static str

Which map was refused.

§width: u32

Texels along +X.

§height: u32

Texels along +Z.

§

MapSize

A map whose contents are not one entry per texel of the grid it was handed with.

Fields

§what: &'static str

Which map was refused.

§width: u32

Texels along +X.

§height: u32

Texels along +Z.

§expected: usize

Entries the grid needs.

§found: usize

Entries that arrived.

§

Height

A height that is not a finite number of metres.

Fields

§height: f32

What was offered.

§at: usize

Where it was.

§

Blades

No blade rows, or more than MAX_BLADES of them.

Fields

§rows: usize

Rows that arrived.

§

Blade

A blade row whose size, spread or lever is not a number a blade can be drawn with.

Fields

§row: usize

Which row was refused.

§what: &'static str

Which field of it.

§value: f32

What was offered.

§

Shells

A shell stack of no layers, or of more than MAX_SHELLS.

Fields

§count: u32

Layers that were asked for.

§

BladeLod

A level-of-detail switch that is not a positive distance, or a band before it that is negative or longer than the distance.

Fields

§distance: f32

The switch distance that was offered.

§band: f32

The band that was offered.

Trait Implementations§

Source§

impl Debug for GrassError

Source§

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

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

impl Display for GrassError

Source§

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

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

impl Error for GrassError

1.30.0 · 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<GrassError> for SetError

Source§

fn from(source: GrassError) -> Self

Converts to this type from the input type.
Source§

impl PartialEq for GrassError

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for GrassError

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> HalThreadSafe for T
where T: Send + Sync,

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 = !

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

fn try_from(value: U) -> Result<T, !>

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.