Enum scan::ScanError
[−]
[src]
pub enum ScanError<F: FromStr> { Parse(F::Err), Io(CharsError), EndOfFile, }
Enum representing an error which can arise when extracting an F from a readable stream.
Examples
let mut scanner = from_stdin(); let result = scanner.next::<i32>(); match result { Err(ScanError::Parse(e)) => println!("Could not parse! Error: {}", e), Err(ScanError::Io(e)) => println!("I/O related error: {}", e), Err(ScanError::EndOfFile) => println!("No more input to read!"), Ok(v) => println!("Integer scanned: {}", v), }
Variants
Parse(F::Err)
A string was tokenized but could not be parsed
Io(CharsError)
An I/O error occured, including a potential UTF-8 error
EndOfFile
No input left to tokenize
Trait Implementations
impl<F: Debug + FromStr> Debug for ScanError<F> where
F::Err: Debug,
[src]
F::Err: Debug,
impl<F> Display for ScanError<F> where
F: FromStr + Debug,
<F as FromStr>::Err: Error,
[src]
F: FromStr + Debug,
<F as FromStr>::Err: Error,
impl<F: FromStr> From<CharsError> for ScanError<F>
[src]
fn from(e: CharsError) -> ScanError<F>
Performs the conversion.
impl<F: FromStr> From<Error> for ScanError<F>
[src]
impl<F> Error for ScanError<F> where
F: FromStr + Debug,
<F as FromStr>::Err: Error + Any,
[src]
F: FromStr + Debug,
<F as FromStr>::Err: Error + Any,