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.
Metres
A tile side, a reach or a texel scale that is not a positive finite number of metres.
Fields
EmptyMap
A map with a zero dimension.
Fields
MapSize
A map whose contents are not one entry per texel of the grid it was handed with.
Fields
Height
A height that is not a finite number of metres.
Blades
No blade rows, or more than MAX_BLADES of them.
Blade
A blade row whose size, spread or lever is not a number a blade can be drawn with.
Fields
Shells
A shell stack of no layers, or of more than MAX_SHELLS.
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.
Trait Implementations§
Source§impl Debug for GrassError
impl Debug for GrassError
Source§impl Display for GrassError
impl Display for GrassError
Source§impl Error for GrassError
impl Error for GrassError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()