[][src]Enum lf2_parse::Error

pub enum Error<'i> {
    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 of DecodeError

error: DecodeError

Underlying DecodeError.

EncodeError

Error while decoding a data file.

Fields of EncodeError

error: EncodeError

Underlying EncodeError.

FileOpenError

Failed to open data file from the file system.

Fields of FileOpenError

path: PathBuf

Path that was attempted to be opened as a file.

io_error: Error

The io::Error returned by the OS.

FileReadError

Failed to read data from a data file.

Fields of FileReadError

path: PathBuf

Path to the file that was attempted to be read.

io_error: Error

The io::Error returned by the OS.

FrameNumberNonUnique

Fields of FrameNumberNonUnique

frame_number: FrameNumber

FrameNumber that is used across multiple frames.

frame_pairs: Vec<Pair<'i, Rule>>

Parsed Pairs of the frames with non-unique frame numbers.

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 of ObjectDataSurplus

object_data: ObjectData

The successfully parsed ObjectData.

surplus_pairs: Pairs<'i, Rule>

Additional pairs.

PestError(Error<Rule>)

Pest could not parse the input with the object grammar.

ParseBdyKind

A pair failed to parse as a BdyKind.

Fields of ParseBdyKind

value_pair: Pair<'i, Rule>

The value that failed to be parsed.

error: BdyKindParseError

The BdyKindParseError from the parse attempt,

ParseCPointKind

A pair failed to parse as an CPointKind.

Fields of ParseCPointKind

value_pair: Pair<'i, Rule>

The value that failed to be parsed.

error: CPointKindParseError

The CPointKindParseError from the parse attempt,

ParseItrKind

A pair failed to parse as an ItrKind.

Fields of ParseItrKind

value_pair: Pair<'i, Rule>

The value that failed to be parsed.

error: ItrKindParseError

The ItrKindParseError from the parse attempt,

ParseItrEffect

A pair failed to parse as an Effect.

Fields of ParseItrEffect

value_pair: Pair<'i, Rule>

The value that failed to be parsed.

error: EffectParseError

The EffectParseError from the parse attempt,

ParseOPointKind

A pair failed to parse as an OPointKind.

Fields of ParseOPointKind

value_pair: Pair<'i, Rule>

The value that failed to be parsed.

error: OPointKindParseError

The OPointKindParseError from the parse attempt,

ParseOPointAction

Failed to parse opoint: action: value as FrameNumberNext.

Fields of ParseOPointAction

value_pair: Pair<'i, Rule>

The value that failed to be parsed.

error: ParseIntError

The OPointKindParseError from the parse attempt,

ParseWPointKind

A pair failed to parse as a WPointKind.

Fields of ParseWPointKind

value_pair: Pair<'i, Rule>

The value that failed to be parsed.

error: WPointKindParseError

The WPointKindParseError from the parse attempt,

ParseWeaponAct

Failed to parse weaponact: value as FrameNumberNext.

Fields of ParseWeaponAct

value_pair: Pair<'i, Rule>

The value that failed to be parsed.

error: ParseIntError

The ParseIntError from the parse attempt,

ParseWeaponStrengthIndex

Failed to parse attacking: value as WeaponStrengthIndex.

Fields of ParseWeaponStrengthIndex

value_pair: Pair<'i, Rule>

The value that failed to be parsed.

error: ParseIntError

The ParseIntError from the parse attempt,

ParseFloat

A pair failed to parse as a float.

Fields of ParseFloat

field: &'static str

Human readable name of the field.

value_pair: Pair<'i, Rule>

The string that failed to be parsed into its value type.

error: ParseFloatError

The ParseFloatError from the parse attempt,

ParseInt

A pair failed to parse as an integer.

Fields of ParseInt

field: &'static str

Human readable name of the field.

value_pair: Pair<'i, Rule>

The string that failed to be parsed into its value type.

error: ParseIntError

The ParseIntError from the parse attempt,

ParsePath

A pair failed to parse as a Path.

Fields of ParsePath

field: &'static str

Human readable name of the field.

value_pair: Pair<'i, Rule>

The string that failed to be parsed into its value type.

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 of GrammarSingle

rule_expected: Rule

The data rule that is valid in this position.

pair_found: Option<Pair<'i, Rule>>

The actual data rule.

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 of Grammar

rules_expected: &'static [Rule]

The data rules that are valid in this position.

pair_found: Option<Pair<'i, Rule>>

The actual data rule.

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.

Fields of ValueExpected

tag_pair: Pair<'i, Rule>

Pair of the preceeding rule.

StateParse

Errors when parsing a string as a State.

Fields of StateParse

value_pair: Pair<'i, Rule>

The string that failed to be parsed into the State.

error: StateParseError

The underlying error.

Unreachable

Variant that should not be reachable, such as through an Infallible error type..

Fields of Unreachable

error: Box<dyn Error>

This should really be unreachable, e.g. the Error type is Infallible during parsing.

Trait Implementations

impl<'i> Debug for Error<'i>[src]

impl<'i> Display for Error<'i>[src]

impl<'i> Error for Error<'i>[src]

impl<'e> From<DecodeError> for Error<'e>[src]

impl<'e> From<EncodeError> for Error<'e>[src]

impl<'i> From<Error<Rule>> for Error<'i>[src]

impl<'e> From<FromUtf8Error> for Error<'e>[src]

Auto Trait Implementations

impl<'i> !RefUnwindSafe for Error<'i>

impl<'i> !Send for Error<'i>

impl<'i> !Sync for Error<'i>

impl<'i> Unpin for Error<'i>

impl<'i> !UnwindSafe for Error<'i>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.