pub enum Error<'i> {
Show 27 variants
DecodeError {
error: DecodeError,
},
EncodeError {
error: EncodeError,
},
FileOpenError {
path: PathBuf,
io_error: Error,
},
FileReadError {
path: PathBuf,
io_error: Error,
},
FrameNumberNonUnique {
frame_number: FrameNumber,
frame_pairs: Vec<Pair<'i, Rule>>,
},
DecodedDataInvalidUtf8(FromUtf8Error),
ObjectDataExpected,
ObjectDataSurplus {
object_data: ObjectData,
surplus_pairs: Pairs<'i, Rule>,
},
PestError(Error<Rule>),
ParseBdyKind {
value_pair: Pair<'i, Rule>,
error: BdyKindParseError,
},
ParseCPointKind {
value_pair: Pair<'i, Rule>,
error: CPointKindParseError,
},
ParseItrKind {
value_pair: Pair<'i, Rule>,
error: ItrKindParseError,
},
ParseItrEffect {
value_pair: Pair<'i, Rule>,
error: EffectParseError,
},
ParseOPointKind {
value_pair: Pair<'i, Rule>,
error: OPointKindParseError,
},
ParseOPointAction {
value_pair: Pair<'i, Rule>,
error: ParseIntError,
},
ParseWPointKind {
value_pair: Pair<'i, Rule>,
error: WPointKindParseError,
},
ParseWeaponAct {
value_pair: Pair<'i, Rule>,
error: ParseIntError,
},
ParseWeaponStrengthIndex {
value_pair: Pair<'i, Rule>,
error: ParseIntError,
},
ParseFloat {
field: &'static str,
value_pair: Pair<'i, Rule>,
error: ParseFloatError,
},
ParseInt {
field: &'static str,
value_pair: Pair<'i, Rule>,
error: ParseIntError,
},
ParsePath {
field: &'static str,
value_pair: Pair<'i, Rule>,
},
ElementBuildNone(Pair<'i, Rule>),
GrammarSingle {
rule_expected: Rule,
pair_found: Option<Pair<'i, Rule>>,
},
Grammar {
rules_expected: &'static [Rule],
pair_found: Option<Pair<'i, Rule>>,
},
ValueExpected {
tag_pair: Pair<'i, Rule>,
},
StateParse {
value_pair: Pair<'i, Rule>,
error: StateParseError,
},
Unreachable {
error: Box<dyn Error>,
},
}Variants§
DecodeError
Error while decoding a data file.
Fields
error: DecodeErrorUnderlying DecodeError.
EncodeError
Error while decoding a data file.
Fields
error: EncodeErrorUnderlying EncodeError.
FileOpenError
Failed to open data file from the file system.
Fields
FileReadError
Failed to read data from a data file.
Fields
FrameNumberNonUnique
Fields
frame_number: FrameNumberFrameNumber that is used across multiple frames.
DecodedDataInvalidUtf8(FromUtf8Error)
Data file is not valid UTF8.
ObjectDataExpected
Expected to parse object data, but got nothing.
ObjectDataSurplus
ObjectData is successfully parsed, but there is surplus data.
Fields
object_data: ObjectDataThe successfully parsed ObjectData.
PestError(Error<Rule>)
Pest could not parse the input with the object grammar.
ParseBdyKind
A pair failed to parse as a BdyKind.
Fields
error: BdyKindParseErrorThe BdyKindParseError from the parse attempt,
ParseCPointKind
A pair failed to parse as an CPointKind.
Fields
error: CPointKindParseErrorThe CPointKindParseError from the parse attempt,
ParseItrKind
A pair failed to parse as an ItrKind.
Fields
error: ItrKindParseErrorThe ItrKindParseError from the parse attempt,
ParseItrEffect
A pair failed to parse as an Effect.
Fields
error: EffectParseErrorThe EffectParseError from the parse attempt,
ParseOPointKind
A pair failed to parse as an OPointKind.
Fields
error: OPointKindParseErrorThe OPointKindParseError from the parse attempt,
ParseOPointAction
Failed to parse opoint: action: value as FrameNumberNext.
Fields
error: ParseIntErrorThe OPointKindParseError from the parse attempt,
ParseWPointKind
A pair failed to parse as a WPointKind.
Fields
error: WPointKindParseErrorThe WPointKindParseError from the parse attempt,
ParseWeaponAct
Failed to parse weaponact: value as FrameNumberNext.
Fields
error: ParseIntErrorThe ParseIntError from the parse attempt,
ParseWeaponStrengthIndex
Failed to parse attacking: value as WeaponStrengthIndex.
Fields
error: ParseIntErrorThe ParseIntError from the parse attempt,
ParseFloat
A pair failed to parse as a float.
Fields
error: ParseFloatErrorThe ParseFloatError from the parse attempt,
ParseInt
A pair failed to parse as an integer.
Fields
error: ParseIntErrorThe ParseIntError from the parse attempt,
ParsePath
A pair failed to parse as a Path.
Fields
ElementBuildNone(Pair<'i, Rule>)
Frame element was built but returned with None.
If this is reached, there is a bug in the Element object data parsing
code.
GrammarSingle
Error should be unreachable based on the lf2_object.pest grammar.
If this variant is hit, then there is a bug in either the grammar, or pest.
Fields
Grammar
Error should be unreachable based on the lf2_object.pest grammar.
If this variant is hit, then there is a bug in either the grammar, or pest.
Fields
ValueExpected
Expected a tag value, but got nothing.
Error should be unreachable based on the lf2_object.pest grammar.
If this variant is hit, then there is a bug in either the grammar, or pest.
StateParse
Errors when parsing a string as a State.
Fields
error: StateParseErrorThe underlying error.
Unreachable
Variant that should not be reachable, such as through an Infallible
error type..