tf2_enum/error.rs
1use crate::Spell;
2use std::fmt;
3
4/// An error when attempting to convert a spell into a sub-set of spells (footprints or paint).
5#[derive(Debug)]
6pub struct TryFromSpellError {
7 pub defindex: u32,
8 pub value: Spell,
9}
10
11impl fmt::Display for TryFromSpellError {
12 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
13 write!(f, "No value matching `{}` for attribute `{}`", self.value, self.defindex)
14 }
15}
16
17impl std::error::Error for TryFromSpellError {}