Enum whiteread::white::Error
[−]
[src]
pub enum Error { TooShort, Leftovers, ParseError, IoError(Error), }
Error which can occur while parsing White
object.
It's convertible into io::Error
, so it composes well with other reading functions.
Examples
if let Err(TooShort) = parse_string::<(u8, u16)>("1") {} else { panic!(); } if let Err(Leftovers) = parse_string::<char>("x y z") {} else { panic!(); } if let Err(ParseError) = parse_string::<i32>("seven") {} else { panic!(); }
Variants
TooShort
There was not enough input to parse a value.
Leftovers
Excessive input was provided.
ParseError
Parse error occured (data was in invalid format).
IoError(Error)
IO Error occured.
Methods
impl Error
[src]
fn is_too_short(&self) -> bool
fn is_leftovers(&self) -> bool
fn is_parse_error(&self) -> bool
fn is_io_error(&self) -> bool
Trait Implementations
impl Debug for Error
[src]
impl From<Error> for Error
[src]
impl Error for Error
[src]
fn description(&self) -> &str
A short description of the error. Read more
fn cause(&self) -> Option<&Error>
The lower-level cause of this error, if any. Read more