Enum poke_a_mango::Error [] [src]

pub enum Error {
    FileParsingFailed {
        desc: &'static str,
        errors: Vec<String>,
    },
    Io {
        desc: &'static str,
        op: &'static str,
    },
    Ui {
        desc: &'static str,
        error: String,
    },
}

Enum representing all possible ways the application can fail.

Variants

Failed to parse the specified file because of the specified errors.

Fields of FileParsingFailed

The file that failed to parse.

The parsing errors that occured.

An I/O error occured.

This includes higher-level I/O errors like FS ones.

Fields of Io

The file that failed to parse.

The failed operation.

This should be lowercase and imperative ("create", "open").

A UI error, like a failure to creat a Window.

Fields of Ui

The UI operation's description.

This should be imperative.

The failed operation, as returned by the UI framework.

Methods

impl Error
[src]

[src]

Get the executable exit value from an Error instance.

Examples

let mut out = Vec::new();
Error::Io {
    desc: "leaderboard",
    op: "write",
}.print_error(&mut out);
assert_eq!(String::from_iter(out.iter().map(|&i| i as char)),
           "Writing leaderboard failed.\n".to_string());

[src]

Get the executable exit value from an Error instance.

Examples

assert_eq!(Error::FileParsingFailed {
    desc: "",
    errors: vec![],
}.exit_value(), 1);

Trait Implementations

impl Debug for Error
[src]

[src]

Formats the value using the given formatter. Read more

impl Clone for Error
[src]

[src]

Returns a copy of the value. Read more

1.0.0
[src]

Performs copy-assignment from source. Read more

impl Hash for Error
[src]

[src]

Feeds this value into the given [Hasher]. Read more

1.3.0
[src]

Feeds a slice of this type into the given [Hasher]. Read more

impl PartialEq for Error
[src]

[src]

This method tests for self and other values to be equal, and is used by ==. Read more

[src]

This method tests for !=.

impl Eq for Error
[src]

Auto Trait Implementations

impl Send for Error

impl Sync for Error