Enum titanic::err::ParseError [−]
pub enum ParseError { Lexer(LexError), UnexpectedToken, UnexpectedSentenceType, Time(ParseError), UnexpectedDir(ArrayVec<[u8; 64]>), Utf8(Utf8Error), InvalidValue(&'static str), Int(ParseIntError), Float(ParseFloatError), InvalidCoord(f64, f64), InvalidUnit, }
Errors that can happen while parsing.
Variants
Lexer(LexError)
Encountered an error while lexing.
UnexpectedToken
Found an unexpected token.
UnexpectedSentenceType
Found an unexptected sentence type.
Time(ParseError)
Failed to parse a FloatLiteral
to a NaiveTime
.
UnexpectedDir(ArrayVec<[u8; 64]>)
Failed to parse a StringLiteral
to a CardDir
.
Utf8(Utf8Error)
Failed to convert to str
.
This should not happen if the lexer only returns ascii bytes.
InvalidValue(&'static str)
Found an invalid value. E.g. a station id not between 0 and 1023, a float with the wrong format for a coordinate, ...
Int(ParseIntError)
Failed to parse an integer.
Float(ParseFloatError)
Failed to parse a float.
InvalidCoord(f64, f64)
Found an invalid coordinate, e.g. latitude outside of the range -90° to +90°.
InvalidUnit
Found an unexpected unit.
Trait Implementations
impl Debug for ParseError
[src]
impl Debug for ParseError
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl Display for ParseError
impl Display for ParseError
impl Error for ParseError
impl Error for ParseError
fn description(&self) -> &str
fn description(&self) -> &str
This method is soft-deprecated. Read more
fn cause(&self) -> Option<&Error>
fn cause(&self) -> Option<&Error>
The lower-level cause of this error, if any. Read more
impl From<LexError> for ParseError
impl From<LexError> for ParseError
fn from(err: LexError) -> ParseError
fn from(err: LexError) -> ParseError
Performs the conversion.
impl From<ParseError> for ParseError
impl From<ParseError> for ParseError
fn from(err: ParseError) -> ParseError
fn from(err: ParseError) -> ParseError
Performs the conversion.
impl From<Utf8Error> for ParseError
impl From<Utf8Error> for ParseError
fn from(err: Utf8Error) -> ParseError
fn from(err: Utf8Error) -> ParseError
Performs the conversion.
impl From<ParseIntError> for ParseError
impl From<ParseIntError> for ParseError
fn from(err: ParseIntError) -> ParseError
fn from(err: ParseIntError) -> ParseError
Performs the conversion.
impl From<ParseFloatError> for ParseError
impl From<ParseFloatError> for ParseError
fn from(err: ParseFloatError) -> ParseError
fn from(err: ParseFloatError) -> ParseError
Performs the conversion.
Auto Trait Implementations
impl Send for ParseError
impl Send for ParseError
impl Sync for ParseError
impl Sync for ParseError